javascript - MomentJS Day diff dates only excluding time -
javascript - MomentJS Day diff dates only excluding time -
is there way of comparing 2 dates without time momentjs
iv tried various formats cant seam work
i have working fine datetime
var expirydate = new date("11/13/2014 11:13:00"); var daysdiff = moment(expirydate).diff(moment(date.now()), 'days');
looking result 14 days no matter time of day
thanks
you can utilize startof function remove time components of both dates
moment(expirydate).startof('day').diff(moment(date.now()).startof('day'), 'days');
javascript momentjs
Comments
Post a Comment