WEEKDAY

function WEEKDAY(arg1: number = null, arg2: number = null): number | string | boolean

Description

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

Parameters

arg1numberdefault: null

Is a number that represents a date.

arg2numberdefault: null

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

number | string | boolean

Try It


const oWorksheet = Api.GetActiveSheet();

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

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

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).