mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
docs: simplify the reference and tighten the verifier (#2736)
This commit is contained in:
1 parent
6af33c7188
commit
7375ac9d80
111 files changed
+1616
-2430
No files matched your search
@@ -26,6 +26,7 @@ import UserSettings from '@app/features/user/state/UserSettings';
|
||||
import * as LocaleUtils from '@app/features/user/utils/LocaleUtils';
|
||||
import {TimeFormatTypes} from '@fluxer/constants/src/UserConstants';
|
||||
import {getFormattedTime} from '@fluxer/date_utils/src/DateFormatting';
|
||||
import {localeUses12Hour} from '@fluxer/date_utils/src/DateHourCycle';
|
||||
import {msg} from '@lingui/core/macro';
|
||||
import {Trans, useLingui} from '@lingui/react/macro';
|
||||
import {clsx} from 'clsx';
|
||||
@@ -293,29 +294,6 @@ const LanguageTab = observer(() => {
|
||||
const appLocale = UserSettings.getLocale();
|
||||
const browserLocale = navigator.language;
|
||||
const effectiveLocale = Accessibility.useBrowserLocaleForTimeFormat ? browserLocale : appLocale;
|
||||
const localeUses12Hour = (locale: string): boolean => {
|
||||
const lang = locale.toLowerCase();
|
||||
const twelveHourLocales = [
|
||||
'en-us',
|
||||
'en-ca',
|
||||
'en-au',
|
||||
'en-nz',
|
||||
'en-ph',
|
||||
'en-in',
|
||||
'en-pk',
|
||||
'en-bd',
|
||||
'en-za',
|
||||
'es-mx',
|
||||
'es-co',
|
||||
'ar',
|
||||
'hi',
|
||||
'bn',
|
||||
'ur',
|
||||
'fil',
|
||||
'tl',
|
||||
];
|
||||
return twelveHourLocales.some((l) => lang.startsWith(l));
|
||||
};
|
||||
const uses12Hour = localeUses12Hour(effectiveLocale);
|
||||
const sampleDate = new Date(2025, 0, 1, 14, 30, 0);
|
||||
const format = getFormattedTime(sampleDate, effectiveLocale, uses12Hour);
|
||||
|
||||
Reference in new issue
Block a user