mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-14 12:18:30 +03:00
Fix locale matching
This commit is contained in:
parent
36f0e7a0c5
commit
9b2c01fb02
2 changed files with 2 additions and 2 deletions
|
@ -16,7 +16,7 @@ function isValidDate(value) {
|
|||
|
||||
const resolvedLocale = new Intl.DateTimeFormat().resolvedOptions().locale;
|
||||
const DTF = mem((locale, opts = {}) => {
|
||||
const lang = localeMatch([locale], [resolvedLocale]);
|
||||
const lang = localeMatch([locale], [resolvedLocale], locale);
|
||||
try {
|
||||
return new Intl.DateTimeFormat(lang, opts);
|
||||
} catch (e) {}
|
||||
|
|
|
@ -9,7 +9,7 @@ const _DateTimeFormat = (opts) => {
|
|||
const { locale, dateYear, hideTime, formatOpts } = opts || {};
|
||||
const loc =
|
||||
locale && !/pseudo/i.test(locale)
|
||||
? localeMatch([locale], [defaultLocale])
|
||||
? localeMatch([locale], [defaultLocale], locale)
|
||||
: defaultLocale;
|
||||
const currentYear = new Date().getFullYear();
|
||||
const options = {
|
||||
|
|
Loading…
Add table
Reference in a new issue