You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I personally like to keep all my apps (especially calendar apps) and my system date/time format consistent with each other. So that I can avoid manual/mental interpretation of date/time I see in apps like google calendar, outlook calendar, calendly etc.
A simple solution I can think of is to add system as a supported format under Intl.DateTimeFormat's options object
Example 1:
If I prefer 12 hour format and is set in my system preference. Then
The following code should generate output shown below
const date = new Date(Date.UTC(2020, 11, 20, 3, 23, 16, 738));
const systemDateTimeFormatter = new Intl.DateTimeFormat('en-GB', { dateStyle: 'medium', timeStyle: 'system short' });
systemDateTimeFormatter.format(date)
// output: 20 Dec 2020 8:53 AM
This feature can be supported by introducing additional values for dateStyle and timeStyle options viz
system short 8:53 AM
system medium 8:53:16 AM
system long 8:53:16.738 AM
system full
I would also like what do others think of this solution and if the feature itself is useful.
title: Browsers to support my system preferred date/time format
date: 2021-05-21T15:54:24.374Z
submitter: Nikhil Mehta
number: 60a7d7b0663eb400b18dbcb6
tags: [ ]
discussion: https://github.com/WebWeWant/webwewant.fyi/discussions/
status: [ discussing || in-progress || complete ]
related:
url:
type: [ article || explainer || draft || spec || note || discussion ]
I personally like to keep all my apps (especially calendar apps) and my system date/time format consistent with each other. So that I can avoid manual/mental interpretation of date/time I see in apps like google calendar, outlook calendar, calendly etc.
A simple solution I can think of is to add system as a supported format under Intl.DateTimeFormat's options object
Example 1:
If I prefer 12 hour format and is set in my system preference. Then
The following code should generate output shown below
const date = new Date(Date.UTC(2020, 11, 20, 3, 23, 16, 738));
const systemDateTimeFormatter = new Intl.DateTimeFormat('en-GB', { dateStyle: 'medium', timeStyle: 'system short' });
systemDateTimeFormatter.format(date)
// output: 20 Dec 2020 8:53 AM
This feature can be supported by introducing additional values for dateStyle and timeStyle options viz
I would also like what do others think of this solution and if the feature itself is useful.
If posted, this will appear at https://webwewant.fyi/wants/60a7d7b0663eb400b18dbcb6/
The text was updated successfully, but these errors were encountered: