Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // If you have a JavaScript project that currently uses
- // the plain Date object of JS and you want to move completely
- // to Moment.js (what you should really do!)
- // you will have to use some different functions.
- // The below list shows the Date object's functions on the left
- // and their Moment.js equivalent on the right side.
- // This is useful for a search/replace task in your IDE.
- .getTime() -> .valueOf()
- .getFullYear() -> .year()
- .getYear() -> .year()
- .getMonth() -> .month()
- .getDate() -> .date()
- .getHours() -> .hours()
- .getMinutes() -> .minutes()
- .setDate( -> .date(
- .setFullYear( -> .year(
- .setHours( -> .hours(
- .setMonth( -> .months(
- .setSeconds( -> .seconds(
- .setMilliseconds( -> .milliseconds(
- .setMinutes( -> .minutes(
- .setTime( -> .unix(
Add Comment
Please, Sign In to add comment