Reputation: 2276
I'm trying the retrieve the corresponding day of the week using moment.js
// e.dayOfTheWeek = 2;
let dayOfTheWeek = moment().day(e.dayOfTheWeek);
console.log(dayOfTheWeek);
returns the following
Moment {_isAMomentObject: true, _isUTC: false, _pf: Object, _locale: Locale, _d: Tue Mar 01 2016 13:35:40 GMT-0500 (Eastern Standard Time)…}
Would like it to return Tuesday
what am I doing wrong?
also tried let dayOfTheWeek = moment().isoWeekday(e.dayOfTheWeek);
same result
Upvotes: 0
Views: 57