跳到主要内容

WEEKNUM

Returns the week number in the year.

Syntax

expression.WEEKNUM(arg1, arg2);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe date-time code used for date and time calculation.
arg2OptionalApiRange | ApiName | numberA number (1 or 2) that determines the type of the return value: Sunday (1) or Monday (2).

Returns

number

Example

const worksheet = Api.GetActiveSheet();

let func = Api.GetWorksheetFunction();
let ans = func.WEEKNUM("11/5/2018", 2);

worksheet.GetRange("C1").SetValue(ans);