DHTMLX Docs & Samples Explorer

getWeekNumber(date)

Returns the week number of the specified date.

Parameters:

  • date - the date you want to get the week number of. Can be specified as a Date object or a string of the predefined format
myCalendar.getWeekNumber(new Date(2013, 0, 1)); //-> 1
//or
myCalendar.setDateFormat("%Y-%m-%d");
myCalendar.getWeekNumber("2013-01-11"); //-> 2

See also: