forked from 77media/video-flow
更新 时间格式取用户浏览器默认语言
This commit is contained in:
parent
177a5c18ab
commit
9d730de2ca
@ -163,14 +163,9 @@ const UsageView: React.FC = () => {
|
|||||||
|
|
||||||
const dateFormatter = useMemo(() => {
|
const dateFormatter = useMemo(() => {
|
||||||
try {
|
try {
|
||||||
return new Intl.DateTimeFormat(undefined, {
|
return new Intl.DateTimeFormat(navigator.languages[0], {
|
||||||
year: 'numeric',
|
dateStyle: 'medium',
|
||||||
month: '2-digit',
|
timeStyle: 'medium',
|
||||||
day: '2-digit',
|
|
||||||
hour: '2-digit',
|
|
||||||
minute: '2-digit',
|
|
||||||
second: '2-digit',
|
|
||||||
hour12: false,
|
|
||||||
});
|
});
|
||||||
} catch {
|
} catch {
|
||||||
return new Intl.DateTimeFormat();
|
return new Intl.DateTimeFormat();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user