Reputation: 1
how can i find the day of the month that current moment date points to. like over here iam trying to invoke dayOfMonth()
var compareDay = function(ts1,ts2){
return (moment(ts1).dayOfMonth() === moment(ts2).dayOfMonth())?true:false;
};
Upvotes: 0
Views: 2327
Reputation: 201439
Per the documentation,
Moment#date is for the date of the month, and Moment#day is for the day of the week.
So I believe you want,
return moment(ts1).date() === moment(ts2).date();
Upvotes: 2