Skip to content

Commit 97d45b4

Browse files
committed
use exec method
1 parent 2888cee commit 97d45b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/utils/datetime.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const datePatternWithoutComma = /^(\w+) (\d+ \w+ \d+)$/;
1212
export function formatDateFull(date) {
1313
const formattedDate = date.toLocaleDateString(locale, dateFullOptions);
1414
// insert comma after day name if not already present
15-
const match = formattedDate.match(datePatternWithoutComma);
15+
const match = datePatternWithoutComma.exec(formattedDate);
1616
if (match) {
1717
return `${match[1]}, ${match[2]}`;
1818
}

0 commit comments

Comments
 (0)