Telegram Web K with changes to work inside I2P
https://web.telegram.i2p/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
485 B
13 lines
485 B
3 years ago
|
export default function getTimeFormat(): 'h12' | 'h23' {
|
||
|
// try {
|
||
|
// const resolvedOptions = Intl.DateTimeFormat(navigator.language, {hour: 'numeric'}).resolvedOptions();
|
||
|
// if('hourCycle' in resolvedOptions) {
|
||
|
// return (resolvedOptions as any).hourCycle === 'h12' ? 'h12' : 'h23';
|
||
|
// } else {
|
||
|
// return resolvedOptions.hour12 ? 'h12' : 'h23';
|
||
|
// }
|
||
|
// } catch(err) {
|
||
|
return new Date().toLocaleString().match(/\s(AM|PM)/) ? 'h12' : 'h23';
|
||
|
// }
|
||
|
}
|