mirror of
https://github.com/samsonjs/strftime.git
synced 2026-04-26 14:47:43 +00:00
fix a bug with ordinal localization fallback
This commit is contained in:
parent
e571efe7bb
commit
1e41e85146
1 changed files with 6 additions and 1 deletions
|
|
@ -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'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue