Skip to content

Commit

Permalink
Fix locale matching
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Aug 22, 2024
1 parent 36f0e7a commit 9b2c01f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/relative-time.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/nice-date-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 9b2c01f

Please sign in to comment.