Skip to content

Commit 31bf0a1

Browse files
committed
fix(date-utils): use current locale for strict parsing
1 parent 327407b commit 31bf0a1

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/date_utils.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ export function parseDate(value, dateFormat, locale, strictParsing, minDate) {
8686
if (strictParsing) {
8787
strictParsingValueMatch =
8888
isValid(tryParseDate, minDate) &&
89-
value ===
90-
format(tryParseDate, df, {
91-
awareOfUnicodeTokens: true,
92-
});
89+
value === formatDate(tryParseDate, df, locale);
9390
}
9491
if (isValid(tryParseDate, minDate) && strictParsingValueMatch) {
9592
parsedDate = tryParseDate;
@@ -103,7 +100,7 @@ export function parseDate(value, dateFormat, locale, strictParsing, minDate) {
103100
if (strictParsing) {
104101
strictParsingValueMatch =
105102
isValid(parsedDate) &&
106-
value === format(parsedDate, dateFormat, { awareOfUnicodeTokens: true });
103+
value === formatDate(parsedDate, dateFormat, locale);
107104
} else if (!isValid(parsedDate)) {
108105
dateFormat = dateFormat
109106
.match(longFormattingTokensRegExp)

0 commit comments

Comments
 (0)