mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-24 02:05:39 +03:00
Make sure nice-date-time also match the more local locale
This commit is contained in:
parent
c54228627c
commit
cea06f32fc
1 changed files with 5 additions and 1 deletions
|
@ -1,12 +1,16 @@
|
|||
import { i18n } from '@lingui/core';
|
||||
|
||||
import localeMatch from './locale-match';
|
||||
import mem from './mem';
|
||||
|
||||
const defaultLocale = new Intl.DateTimeFormat().resolvedOptions().locale;
|
||||
|
||||
const _DateTimeFormat = (opts) => {
|
||||
const { locale, dateYear, hideTime, formatOpts } = opts || {};
|
||||
const loc = locale && !/pseudo/i.test(locale) ? locale : defaultLocale;
|
||||
const loc =
|
||||
locale && !/pseudo/i.test(locale)
|
||||
? localeMatch([locale], [defaultLocale])
|
||||
: defaultLocale;
|
||||
const currentYear = new Date().getFullYear();
|
||||
const options = {
|
||||
// Show year if not current year
|
||||
|
|
Loading…
Reference in a new issue