This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26119 - An upper limit to the length of a year should be specified.
Summary: An upper limit to the length of a year should be specified.
Status: RESOLVED WORKSFORME
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-17 16:24 UTC by Scott Sheehan
Modified: 2016-04-27 18:15 UTC (History)
7 users (show)

See Also:


Attachments

Description Scott Sheehan 2014-06-17 16:24:56 UTC
The text for parsing a year in <input type="date"> says a year should be of the form: "Four or more ASCII digits, representing year, where year > 0"

This should probably have a reasonable upper limit on the length of the year. I suggest this be exactly four ASCII digits.
Comment 1 Boris Zbarsky 2014-06-17 16:27:28 UTC
That doesn't seem very future-compatible...
Comment 2 Mounir Lamouri 2014-06-18 10:26:14 UTC
Does Date (JS) has an upper limit?
Comment 3 Robin Berjon 2014-06-18 11:46:50 UTC
FWIW ISO 8601 supports years beyond 9999 (though somewhat shakily). Obviously, I'd expect real-world date parsers to regularly fail on those.
Comment 4 Boris Zbarsky 2014-06-18 14:05:31 UTC
> Does Date (JS) has an upper limit?

Sort of.  It has the limit that only dates whose numeric value is < 1e8 days (so about 273000 years from 1970) are representable.

It also defines the string format as YYYY-MM-DDTHH:mm:ss.sssZ, based on ISO8601, but also defines a string format for years past that point.  See http://people.mozilla.org/~jorendorff/es6-draft.html#sec-extended-years

  new Date(4.32e15).toISOString()

seems to work in UAs, modulo https://bugzilla.mozilla.org/show_bug.cgi?id=730831 in Firefox.
Comment 5 Mounir Lamouri 2014-06-30 10:06:12 UTC
Would that make sense to say that the year's upper-limit for <input type='date'> should match the one in JS' Date?
Comment 6 Travis Leithead [MSFT] 2016-04-27 18:15:20 UTC
HTML5.1 Bugzilla Bug Triage: Works for me

I'm guessing that by the time we need to worry about extending the year's date to anything beyond 4 digits, we'll be using some other time measurement system (Galactic time?)

If this resolution is not satisfactory, please copy the relevant bug details/proposal into a new issue at the W3C HTML5 Issue tracker: https://github.com/w3c/html/issues/new where it will be re-triaged. Thanks!