Skip to content

Commit a225f9a

Browse files
committed
♿️ Fix Calendar auto navigation regex issue for month navigation
- Fix the month matching regex to look for patterns like "03/", "/03", "03-", "-03" or standalone "03" at start - Avoid the optional matching of month pattern within year pattern Closes #6214
1 parent 548a1f3 commit a225f9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/date_utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ export function parseDateForNavigation(
359359

360360
// Try to extract a month (1-12) from the input
361361
// Look for patterns like "03/", "/03", "03-", "-03" or standalone "03" at start
362-
const monthMatch = value.match(/(?:^|[/\-\s])?(0?[1-9]|1[0-2])(?:[/\-\s]|$)/);
362+
const monthMatch = value.match(/(?:^|[/\-\s])(0?[1-9]|1[0-2])(?:[/\-\s]|$)/);
363363
const month =
364364
monthMatch && monthMatch[1]
365365
? parseInt(monthMatch[1], 10) - 1

0 commit comments

Comments
 (0)