IJMacD / rfc3339-iso8601

https://ijmacd.github.io/rfc3339-iso8601
291 stars 11 forks source link

Date without year #2

Closed kaleb closed 3 years ago

kaleb commented 3 years ago

ISO8601 also supports dates without years which is a convenient way to represent birthdays or holidays: --12-25

It would be a good addition to this comparison.

IJMacD commented 3 years ago

ISO 8601:2000 Allowed a month and day without a year in what was known as Truncated representations. These formats omitted some of the most significant digits. Ref: ISO 8601:2000 § 5.2.1.3 Truncated representations

Allowed examples included:

However, all the truncated representations were removed in ISO 8601:2004.

Reduced precision formats are still allowed i.e. Omitting some of the least significant digits. Ref: ISO 8601:2004 § 4.1.2.3 Representations with reduced accuracy

The diagrams get complicated if you try to add extra circles for the various editions of the ISO standard. I'm just aiming to represent ISO 8601:2019 right now. I might consider adding an options for users to compare historical versions in the future.

kaleb commented 3 years ago

I did not realize those were removed. Thanks!

On Sat, Sep 4, 2021, 11:55 Iain MacDonald @.***> wrote:

ISO 8601:2000 Allowed a month and day without a year in what was known as Truncated representations. These formats removed some of the most significant digits. Ref: ISO 8601:2000 § 5.2.1.3 Truncated representations

Allowed examples included:

  • YY-MM-DD
  • -YY-MM
  • -YY
  • --YY-MM
  • --MM
  • ---DD

However, all the truncated representations were removed in ISO 8601:2004.

Reduced precision formats are still allowed i.e. Omitting some of the least significant digits. Ref: ISO 8601:2004 § 4.1.2.3 Representations with reduced accuracy

The diagrams get complicated if you try to add extra circles for the various editions of the ISO standard. I'm just aiming to represent ISO 8601:2019 right now. I might consider adding an options for users to compare historical versions in the future.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/IJMacD/rfc3339-iso8601/issues/2#issuecomment-912995844, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD2IZBJ5ZWJSBLXBFDEL43UAI6OTANCNFSM5DNL7FQQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Crissov commented 5 months ago

Just for the record, EDTF Level 2 in ISO 8601-2 adds X as an Unspecified Digit in all places, so XXXX-12-25 would be a replacement for the initial example. (Level 1 only supports replacement of the rightmost components.)