Skip to content

Commit 0c11c7e

Browse files
committed
Only call localCheck when time is involved
1 parent 3ca5781 commit 0c11c7e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/date.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2477,15 +2477,12 @@ function getNewLocale(def) {
24772477
function addCoreFormats() {
24782478
forEach(CoreParsingFormats, function(df) {
24792479
var src = df.src;
2480-
if (df.localeCheck && !df.localeCheck(loc)) {
2481-
return;
2482-
}
24832480
if (df.mdy && loc.mdy) {
24842481
// Use the mm/dd/yyyy variant if it
24852482
// exists and the locale requires it
24862483
src = df.mdy;
24872484
}
2488-
if (df.time) {
2485+
if (df.time && !df.localeCheck || (df.localeCheck && !df.localeCheck(loc))) {
24892486
// Core formats that allow time require the time
24902487
// reg on both sides, so add both versions here.
24912488
loc.addFormat(getFormatWithTime(src, true));

test/tests/locales/fi.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace('Date | Finnish', function () {
1111

1212
method('create', function() {
1313

14+
assertDateParsed('1.12.2019', new Date(2019, 11, 1));
1415
assertDateParsed('15. toukokuuta 2011', new Date(2011, 4, 15));
1516
assertDateParsed('torstai 5. tammikuuta 2012', new Date(2012, 0, 5));
1617
assertDateParsed('torstaina 5. tammikuuta 2012', new Date(2012, 0, 5));

0 commit comments

Comments
 (0)