- 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 - Is a Duration
This method is used to check if the variable is a moment duration object.
Syntax
moment.isDuration(obj);
Example
var d = moment.isDuration(moment.duration(2, 'weeks')); var st = moment.isDuration(moment()); var s = moment.isDuration(new Date());
Output
momentjs_durations.htm
Advertisements