ISO Calendar
npm install moment-isocalendar
If you are looking for a Python-like isocalendar method, you can use Rocky Meza's plugin
moment-isocalendar
Calling the isocalendar method on a moment will return an array like the following:
[year, week_of_year, day_of_week, minutes_since_midnight]
moment().isocalendar(); // [2012, 8, 5, 870]
You can also reconstruct a moment from a isocalendar array.
moment.fromIsocalendar([2011, 51, 5, 870]).format('LLLL');
// "Friday, December 23 2011 2:30 PM"
The repository is located at github.com/fusionbox/moment-isocalendar.
当前内容版权归 momentjs.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 momentjs.com .