I’ve been kinda stumped by this, because I can’t imagine why this error is occuring.
For testing purposes, I ran this from the same file the error was occuring in:
console.log('Date: ' + this.date);
console.log('YYYY: ' + moment(this.date).format('YYYY'));
console.log('MMM: ' + moment(this.date).format('MMM'));
console.log('MMMM: ' + moment(this.date).format('MMMM'));
console.log('DD: ' + moment(this.date).format('DD'));
console.log('DDD: ' + moment(this.date).format('DDD'));
console.log('DDDD: ' + moment(this.date).format('DDDD'));
Which gives me this output:
Date: 02/01/2018
YYYY: 2018
MMM: Feb
MMMM: February
DD: 01
DDD: 32
DDDD: 032
It can’t be a problem with the type conversion, since the month name returns just fine. Getting the day as a number works also, but what’s happening with the weekday name?
I’m running Ionic v3.9.2 btw.