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

Add support for iso8601 YYYY-MM format #1463

Closed
wants to merge 1 commit into from

Conversation

jonwolski
Copy link

@jonwolski jonwolski commented Oct 20, 2016

The iso 8601 spec allows for omission of the 'day' part of a date
representation. However, because it also allows omission of the month in
the case of YYYY-DDD (where DDD represents the day-of-year), there
is some abiguity.

If there are only two components, a four-digit year,
followed by a dash (-) followed by another series of digits, the
disambiguation is as follows:

  • If there are two digits in the second component, that component
    represents the month.
  • If there are three digits in the second component, that component
    represents the day-of-year.

The existing implementation has affordances for many things that are not
consistent with iso 8601. Rather than make a large,
backwards-incompatible change, I thought it best to fix this one edge
case.

https://bugs.ruby-lang.org/issues/12833

@sbussard
Copy link

sbussard commented Oct 20, 2016

It looks like there was a network error in AppVeyor when attempting to download zlib 1.2.8 from sourceforge. Someone with the correct permissions probably needs to run AppVeyor again, since the failure appears to be non-deterministic.

appveyor DownloadFile http://downloads.sourceforge.net/project/libpng/zlib/1.2.8/zlib128.zip
Error downloading remote file: One or more errors occurred.
Inner Exception: Unable to connect to the remote server
Command exited with code 2

image

@christophermancini
Copy link

👍 I am always for stricter adherence to standards. Tests pass on Travis and the code looks good to me.

The iso 8601 spec allows for omission of the 'day' part of a date
representation. However, because it also allows omission of the month in
the case of `YYYY-DDD` (where `DDD` represents the day-of-year), there
is some abiguity.

If there are only two components, a four-digit year,
followed by a dash (`-`) followed by another series of digits, the
disambiguation is as follows:

* If there are two digits in the second component, that component
  represents the month.
* If there are three digits in the second component, that component
  represents the day-of-year.

The existing implementation has affordances for many things that are not
consistent with iso 8601. Rather than make a large,
backwards-incompatible change, I thought it best to fix this one edge
case.
@jonwolski
Copy link
Author

This might be frowned upon, but a rebase to latest trunk and push -f triggered a successful (re-) build.

@jonwolski
Copy link
Author

FWIW, https://github.com/arnau/ISO8601/blob/master/docs/date-time.md provides what I need. It would be slightly better if that gem allowed for monkey-patching the core date module to 'repair' it.

@jonwolski
Copy link
Author

jonwolski commented Jul 16, 2019

@nobu was this closed just to tidy up, or will this patch actually be accepted? Nevermind, I saw it on https://bugs.ruby-lang.org/issues/12833. Sorry to '@' you

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

Successfully merging this pull request may close these issues.

4 participants