MomentJS - Days


Advertisements

This method will get the days in a duration. The value returned will be 0-30. moment.duration().asDays()gets the numbers of day in a given duration.

Syntax

moment.duration().days();
moment.duration().asDays();

Example

var d = moment.duration(500, "days").days();
var asdays = moment.duration(500, "days").asDays();

Output

Days
momentjs_durations.htm
Advertisements