mirror of
https://github.com/sim1222/misskey.git
synced 2025-08-04 07:26:29 +09:00
use Intl.DateTimeFormat and Intl.NumberFormat instead of toLocaleString (#9444)
This commit is contained in:
12
packages/frontend/src/scripts/intl-const.ts
Normal file
12
packages/frontend/src/scripts/intl-const.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { lang } from '@/config';
|
||||
|
||||
export const versatileLang = (lang ?? 'ja-JP').replace('ja-KS', 'ja-JP');
|
||||
export const dateTimeFormat = new Intl.DateTimeFormat(versatileLang, {
|
||||
year: 'numeric',
|
||||
month: 'numeric',
|
||||
day: 'numeric',
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
second: 'numeric',
|
||||
});
|
||||
export const numberFormat = new Intl.NumberFormat(versatileLang);
|
Reference in New Issue
Block a user