Function Date.getFirstDateInWeek
Returns the date of monday in any given year and week
-
Syntax
Date Date.getFirstDateInWeek(Number year , Number week )
This function will create a date object with the date set to the monday of the year and week provided. Numbers forweekroll over meaning week 54 of 2008 is interpreted as week 1 of 2009. Negative numbers can be used as well. -
Parameters
Number year- The year
Number week- The week
- Return value A Date object set to the monday of the year and week specified.
-
Examples
- To get the date of monday in week 23 of year 2003
// Create date var d = Date.getFirstDateInWeek(2003,23); // Output is 'Monday 2nd of June 2003' d.toString():
- Related Date.format
-
Download
Source
Unless otherwise noted all code in the JSLab Standard Library is licensed as GPLv3. See http://www.gnu.org/licenses/gpl.html for the entire license.
This function has dependencies and will not work stand-alone. Use the download button above instead of copy/paste.
