From 1e41e851462e01e88d6a2443ec0c90fa06b4cda0 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Wed, 28 Dec 2016 11:23:19 -0800 Subject: [PATCH] fix a bug with ordinal localization fallback --- strftime.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/strftime.js b/strftime.js index 5b4fb13..4d1fce3 100644 --- a/strftime.js +++ b/strftime.js @@ -621,7 +621,12 @@ // 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. 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; // 'AM'