I am trying to convert beginIntervalDate into ddd D MMM YYYY format in Swedish locale, however it displays Thu Jan 05 2017 instead of tor jan 05 2017. I cannot figure what am I doing wrong here.
Here is the code snippets:
const beginIntervalDate = moment(beginDate, dateFormatsI18n.beginDateFormat);
dateFormatsI18n is coming from here:
beginDateFormat: {
id: 'scheduling-appointment-type-card-list.AppointmentContainer.beginDateFormat',
description: 'Format for the begin date',
defaultMessage: 'ddd, MMM D, YYYY',
})
const dateFormatsI18n = {
beginDateFormat: intl.formatMessage(i18n.beginDateFormat),
}
Respective translation file :
scheduling-appointment-type-card-list.AppointmentContainer.beginDateFormat": "ddd D MMM YYYY"