this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Test more localized date time format

+5 -4
+5 -4
src/utils/nice-date-time.js
··· 3 3 import localeMatch from './locale-match'; 4 4 import mem from './mem'; 5 5 6 - const defaultLocale = mem( 7 - () => new Intl.DateTimeFormat().resolvedOptions().locale, 8 - ); 6 + const locales = mem(() => [ 7 + ...navigator.languages, 8 + new Intl.DateTimeFormat().resolvedOptions().locale, 9 + ]); 9 10 10 11 const _DateTimeFormat = (opts) => { 11 12 const { locale, dateYear, hideTime, formatOpts, forceOpts } = opts || {}; 12 13 const regionlessLocale = locale.replace(/-[a-z]+$/i, ''); 13 - const loc = localeMatch([regionlessLocale], [defaultLocale], locale); 14 + const loc = localeMatch([regionlessLocale], locales(), locale); 14 15 const currentYear = new Date().getFullYear(); 15 16 const options = forceOpts || { 16 17 // Show year if not current year