use Intl.DateTimeFormat and Intl.NumberFormat instead of toLocaleString (#9444)

This commit is contained in:
tamaina 2023-01-01 17:11:33 +09:00 committed by GitHub
parent 0222165bd9
commit c3a36698e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 42 additions and 18 deletions

View 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);