Want to see pretty graphs? Log in now!
npm install moment-isocalendar
|3||downloads in the last week|
|6||downloads in the last month|
|Last Published By|
|Version||0.1.0 last updated 2 years ago|
|Keywords||moment, isocalendar, iso, date|
This plugin provides a Python-like isocalendar method to moment objects.
How to use?
Simply call the
isocalendar method on any moment object. It returns an array
of four items:
moment(new Date(2011, 11, 23, 14, 30)).isocalendar(); // [2011, 51, 5, 870]
Additionally, there is a function that provides the inverse functionality, it takes an isocalendar array and returns a moment object.
moment.fromIsocalendar([2011, 51, 5, 870]).format('LLLL'); // "Friday, December 23 2011 2:30 PM"
How to test?
Make sure you have all the dependencies and run
make test. You will also need
Python installed on your computer as the tests compare results against those
returned from Python. (Python scripts can be found in