From ba0e06a61747458b9832caa71af7f8154ccf9c07 Mon Sep 17 00:00:00 2001 From: lubber-de Date: Mon, 11 Nov 2024 22:38:24 +0100 Subject: [PATCH] fix(calendar): shortyear handling was broken --- src/definitions/modules/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/definitions/modules/calendar.js b/src/definitions/modules/calendar.js index 61d7edd1d4..7ff6b4dfd5 100644 --- a/src/definitions/modules/calendar.js +++ b/src/definitions/modules/calendar.js @@ -1699,7 +1699,7 @@ text = settings.monthFirst || !/^\d{1,2}[./-]/.test(text) ? text : text.replace(/[./-]/g, '/').replace(/(\d+)\/(\d+)/, '$2/$1'); var textDate = new Date(text); var numberOnly = text.match(/^\d+$/) !== null; - var isShortYear = text.match(/^\d{1,2}[./-]\d{1,2}[./-]\d{1,2}$/) !== null; + var isShortYear = text.match(/^(?:\d{1,2}[./-]){2}\d{1,2}$/) !== null; if (!isShortYear && !numberOnly && !isNaN(textDate.getDate())) { return textDate; }