This method is used to check if the variable is a moment duration object.
moment.isDuration(obj);
var d = moment.isDuration(moment.duration(2, 'weeks')); var st = moment.isDuration(moment()); var s = moment.isDuration(new Date());