Skip to content

Commit

Permalink
fix(calendar): shortyear handling was broken
Browse files Browse the repository at this point in the history
  • Loading branch information
lubber-de committed Nov 11, 2024
1 parent 8963e92 commit ba0e06a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/definitions/modules/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ba0e06a

Please sign in to comment.