Closed GoogleCodeExporter closed 9 years ago
Totally agree. I'm going to rewrite .getWeekOfYear to follow ISO 8601. This
should
be added very soon.
I was not aware of the bug you noted above. Thanks for pointing it out.
Original comment by geoff%co...@gtempaccount.com
on 28 Feb 2008 at 5:26
The .getWeekOfYear function has been removed and replaced with the following
two
functions.
1. .getWeek() - Returns the week number. The first week of the year is the week
which contains the first Thursday. Monday is considered the first day of the
week.
Example
Date.today().getWeek();
2. .getISOWeek() - Converts the date to it's UTC value before getting week
number.
Example
Date.today().getISOWeek();
I also added a .setWeek() function which moves the date to Monday of the week
set.
Example
Date.today().setWeek(1); // set to the Monday of the first week of year
I also added "week" as a config option in .set().
Example
Date.today().set({week: 1}); // set to first week of year
Hope this helps.
Original comment by geoff%co...@gtempaccount.com
on 6 Apr 2008 at 9:56
Original issue reported on code.google.com by
patrik0c...@gmail.com
on 27 Feb 2008 at 9:19