- MomentJS Tutorial
- MomentJS - Home
- MomentJS - Overview
- MomentJS - Environment Setup
- MomentJS - Introduction
- MomentJS - Parsing Date And Time
- MomentJS - Date Validation
- MomentJS - Getter/Setter
- Manipulate Date And Time
- Formatting Date And Time
- MomentJS - Date Queries
- MomentJS - Internationalization
- MomentJS - Customization
- MomentJS - Durations
- MomentJS - Utilities
- MomentJS - Plugins
- MomentJS - Examples
- MomentJS Useful Resources
- MomentJS - Quick Guide
- MomentJS - Useful Resources
- MomentJS - Discussion
MomentJS - Days
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
momentjs_durations.htm
Advertisements