-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Space as date/time separator #2276
Comments
The proposed change would also disallow
I think the space is allowed to make it a bit more human-readable when using <time>2011-11-18 14:54:39</time> but maybe it could be required to use T there as well, and use |
Oh, you're right. My intention was just disallowing space separator, and |
In httparchive (~500,000 pages) I see 6126 pages using |
AFAICT based on Chrome and Edge, Given that
Exactly. The point of allowing space inside the
I believe this is a bad idea. Changing the global datetime format now for the purpose of some theoretical consistency between the Fwiw, I’m who has originally proposed space as allowed date/time separator in the |
@Marat-Tanalin this is not about internal representation (which would probably be a |
@zcorpan That’s clear. Given that, indeed, value of |
A "T" is as human-writable as a space. The Since we have interop on only-T for the What is up for discussion is what to do about the |
What has once been written by a human is then almost inevitably read by a human during maintenance.
Indeed. |
I think the space is what makes us inconsistent with the ISO standard for dates and also JavaScript. See also https://mail.mozilla.org/pipermail/es-discuss/2013-April/030207.html. |
Thanks @annevk. So TC39 did not adopt the space it seems. Having inconsistent rules between JS and HTML sucks. Having inconsistent rules between different features in HTML would still suck. I would prefer one of the following:
I understand some people (including @Marat-Tanalin) would be unhappy if we make them start using |
I don’t actually see what the real issue is. Supporting both Note that changing anything Btw, httparchive is probably not the same thing as the real internet. cc @tantek |
FYI, WebKit is aligning with the specification (and Gecko) here, and supporting both 'T' and ' ' as separator. |
I believe these are the related chrome bug and wpt:
If chrome is the odd one out, then I'd be happy to align it |
Great, any final thoughts @zcorpan? I think this can be closed. |
Once this lands, all browsers and the spec should match I think. I agree this issue can be closed. |
Tentatively closing, @zcorpan can reopen as needed. Thanks @josepharhar! |
So HTML is at least internally consistent, but JS is different.
The issue is not implementation complexity, but the cost for web developers having to learn and remember inconsistent rules in different parts of the web platform. |
Specification:
https://html.spec.whatwg.org/multipage/forms.html#local-date-and-time-state-(type=datetime-local)
https://html.spec.whatwg.org/multipage/infrastructure.html#valid-local-date-and-time-string
WPT tests:
http://w3c-test.org/html/semantics/forms/the-input-element/datetime-local.html
http://w3c-test.org/html/semantics/forms/constraints/form-validation-validity-valueMissing.html
So,
<input type=datetime-local value="2017-01-20 18:09">
has a valid value. However, existing type=datetime-local implementations (Mobile Safari, Google Chrome, and Edge) supports onlyT
separator.This micro syntax is used in
<time datetime=...>
too though UAs do nothing for it.Proposal:
<input type=datetime-local>
accepts only valid normalized local date and time string instead of local date and time string.The text was updated successfully, but these errors were encountered: