I am trying to get year, month and day from below code but getting wrong.
import dateUtils from 'app/utils/date-utils';
const today = dateUtils.momentToKey();
const todayMoment = this.dateUtils.keyToMoment(today);
const newYear = todayMoment.year();
const newMonth = todayMoment.month();
const newDay = todayMoment.date();
console.log('newYear : ', newYear);
console.log('newMonth : ', newMonth);
console.log('newDay : ', newDay);
Could you guide me what's wrong in code?