You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand why the week function returns 1 in the above - but this really coincides with week 1 of year 2013, right? How do I get the year part of the week function?
Maybe there is a better way to achieve what I am after. I have incidents per date from many years. I want to graph the number of incidents by week. But the year/week behavior above will group 12-31-2012 data into the first week of 2012.
The text was updated successfully, but these errors were encountered:
Related to #613
A bit of work is needed to extract the year from weekOfYear function in conjunction with the week number to provide all these format tokens described in the bottom.
There are local week numbers -- for all locales the first day of the week is defined, as well as how to determine which is the first week of a year. There is also an isoWeek that follows some standard, but the isoYear is missing.
From: http://jsfiddle.net/SvJ8Q/1/
(moment("2012-12-31").year())
=> 2012
(moment("2012-12-31").week())
=> 1
(moment("2013-01-01").week())
=> 1
(moment("2013-11-08").year())
=> 2013
(moment("2013-01-08").week())
=> 2
I understand why the week function returns 1 in the above - but this really coincides with week 1 of year 2013, right? How do I get the year part of the week function?
Maybe there is a better way to achieve what I am after. I have incidents per date from many years. I want to graph the number of incidents by week. But the year/week behavior above will group 12-31-2012 data into the first week of 2012.
The text was updated successfully, but these errors were encountered: