jQuery & jQuery UI Documentation

jQuery & jQuery UI

iso8601Week

« Back to UI/Datepicker

iso8601Week( date )

Determine the week of the year for a given date: 1 to 53.
This function uses the ISO 8601 definition of a week: weeks start on a Monday and the first week of the year contains January 4. This means that up to three days from the previous year may be included in the of first week of the current year, and that up to three days from the current year may be included in the last week of the previous year.

This function is the default implementation for the calculateWeek option.
Arguments:
date Date
The date to find the week for.


Examples:
Find the week of the year for a date.

$.datepicker.iso8601Week(new Date(2007, 1 - 1, 26));