Skip to content

Commit

Permalink
fix(calendar): shortyear handling was broken
Browse files Browse the repository at this point in the history
the short year settings centuryBreak and currentCentury were broken/not respected
  • Loading branch information
lubber-de authored Nov 12, 2024
1 parent ff78834 commit cf152e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/definitions/modules/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,8 @@
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;
if (!numberOnly && !isNaN(textDate.getDate())) {
var isShortYear = text.match(/^(?:\d{1,2}[./-]){2}\d{1,2}$/) !== null;
if (!isShortYear && !numberOnly && !isNaN(textDate.getDate())) {
return textDate;
}
text = text.toLowerCase();
Expand Down

0 comments on commit cf152e2

Please sign in to comment.