weekInYear
Function
Definition
Package:@progress/kendo-date-math
Syntax:
ts
weekInYear(new Date(2016, 0, 1)); // Week 53, 2015
weekInYear(new Date(2016, 0, 5)); // Week 1, 2016
weekInYear(new Date(2017, 0, 1)); // Week 52, 2016
weekInYear(new Date(2017, 0, 2)); // Week 1, 2017
A function that returns the number of the week within a year, which is calculated in relation to the date.
For more information, refer to the ISO week date article.
Parameters:dateDate
The date used for the week number calculation.
weekStartDayDayThe first day of the week. By default, the first week day is Monday.
Returns:number
- The number of the week within the year.