fix a bug with ordinal localization fallback

This commit is contained in:
Sami Samhuri 2016-12-28 11:23:19 -08:00
parent e571efe7bb
commit 1e41e85146

View file

@ -621,7 +621,12 @@
// Try to use an ordinal suffix from the locale, but fall back to using the old // Try to use an ordinal suffix from the locale, but fall back to using the old
// function for compatibility with old locales that lack them. // function for compatibility with old locales that lack them.
var day = date.getDate(); var day = date.getDate();
resultString += String(day) + (locale.ordinalSuffixes[day - 1] || ordinal(day)); if (locale.ordinalSuffixes) {
resultString += String(day) + (locale.ordinalSuffixes[day - 1] || ordinal(day));
}
else {
resultString += String(day) + ordinal(day);
}
break; break;
// 'AM' // 'AM'