TRY NEW VERSION

WEEKDAY

WEEKDAY(arg1, arg2) → { number | string | boolean }

Returns a number from 1 to 7 identifying the day of the week of a date..

Parameters:

Name Type Description
arg1 number

Is a number that represents a date.

arg2 number

Is a number: for Sunday=1 through Saturday=7, use 1; for Monday=1 through Sunday=7, use 2; for Monday=0 through Sunday=6, use 3.

Returns:

Type
number | string | boolean

Example

Copy code
builder.CreateFile("xlsx");

const oWorksheet = Api.GetActiveSheet();

var oFunction = Api.GetWorksheetFunction();
var ans = oFunction.WEEKDAY("11/5/2018", 2); 

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

builder.SaveFile("xlsx", "WEEKDAY.xlsx");
builder.CloseFile();

Resulting document