Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(input[date]): support years with more than 4 digits #13735

Closed
@gkalpak

Description

@gkalpak

Currently, (mainly because of the REGEXPs used for parsing dates, e.g. here and there), date-family inputs do not support years with more than 4 digits (they consider the value invalid and the parser returns undefined).

According to the W3 spec, the value of a date-family input should be a "valid full-date as defined in [RFC 3339], with the additional qualification that the year component is four or more digits representing a number greater than 0" (emphasis mine).

Additionally, ISO 8601 allows (upon agreement of the involved parties) to have expanded representation of years (with more than 4 digits); see for example sections 2.3.8 and 4.1.2.4.

Current browser support:

  • Chrome, Opera: Support date inputs and years greater than 9999.
  • Firefox, IE: Do not support date inputs, but the user can still enter the dates in ISO format and ngModel parses them correctly
  • Edge: Supports date inputs, but not years greater than 9999.
  • Safari: ???

There's nothing we can do for MS Edge on the Angular side, but the users of other browsers will still benefit from adding support for years greater than 9999.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions