Skip to content

Commit 212c014

Browse files
committed
Loading of locale files should be case insensitive
Fixes issue found in #1688 Always use tolower
1 parent 9f3d950 commit 212c014

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/date.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,11 @@ export function initDayJsPlugins() {
8888
}
8989

9090
export async function setDateLocale(locale: string) {
91+
locale = locale.toLowerCase();
9192
if (locale !== dayjs.locale()) {
92-
const localePath = resourcePath(`library/dayjs/locale/${locale}.js`);
93+
const localePath = resourcePath(
94+
`library/dayjs/locale/${locale}.js`,
95+
);
9396
if (existsSync(localePath)) {
9497
const localeUrl = toFileUrl(localePath).href;
9598
const localeModule = await import(localeUrl);

0 commit comments

Comments
 (0)