From 7bec100c86462e3105b0ed19909b6d4ba37c45af Mon Sep 17 00:00:00 2001 From: Alan Date: Wed, 15 Dec 2021 16:45:36 +0800 Subject: [PATCH] Date.js --- Date.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Date.js b/Date.js index 6f217a5d55..687a8ae305 100644 --- a/Date.js +++ b/Date.js @@ -371,7 +371,7 @@ Date.formatCodeToRegex = function(character, currentGroup) { s:"(\\d{1,2})"}; // Numeric representation of a month, without leading zeros case "m": return {g:1, - c:"m = parseInt(results[" + currentGroup + "], 10) - 1;\n", + c:"m = Math.max(0,parseInt(results[" + currentGroup + "], 10) - 1);\n", s:"(\\d{2})"}; // Numeric representation of a month, with leading zeros case "t": return {g:0, -- 2.39.2