118
rated 0 times
[
123]
[
5]
/ answers: 1 / hits: 26611
/ 10 Years ago, tue, may 27, 2014, 12:00:00
Can you help me in formatting a UTC date into a textual representation in a local language (Dutch to be specific).
The code
var realDate = moment.utc(birthday);
var now = moment();
birthdayToday = (realDate.month() == now.month() && realDate.date() == now.date());
data.Birthdays.push({
Name: preferredName,
Birthday: birthdayToday ? 'Today!' : realDate.format(MMMM D),
Path: path,
PhotoUrl: photoUrl,
AccountName: accountName,
BirthdayIsToday: birthdayToday
});
Because of the line realDate.format(MMMM D), this current displays as May 31, June 6 etc.
What I want is 31 Mei, 6 Juni (dutch dates).
I dont see a clear example in the documentation on how to use format with a local language
Any help appreciated!
More From » momentjs