Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browsers to support my system preferred date/time format #383

Open
WebWeWantBot opened this issue May 21, 2021 · 1 comment
Open

Browsers to support my system preferred date/time format #383

WebWeWantBot opened this issue May 21, 2021 · 1 comment
Assignees

Comments

@WebWeWantBot
Copy link


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:

  • title:
    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

  1. system short 8:53 AM
  2. system medium 8:53:16 AM
  3. system long 8:53:16.738 AM
  4. system full

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/

@meyerweb
Copy link
Member

meyerweb commented Jun 8, 2021

This should be promoted to a want, and linked with https://webwewant.fyi/wants/59/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants