Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49315

DateTime format not working correctly for weekdays

$
0
0

@besasam wrote:

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.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49315

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>