Monday, March 7, 2016

momentjs usage

Date Formatting
moment().format('YYYY MM DD');

Date Validation
moment(dateEntered,'MM-DD-YYYY').isValid()

Manipulating Dates
moment().add('days', 7);

Time From Now
moment().fromNow();

Calculating the Difference Between Dates
dateB.diff(dateC)

Date Queries
These methods are isBefore(), isAfter(), and isSame()

International Language Support
moment.lang('fr' {})

No comments:

Post a Comment