Draft for updating conversions#224
Open
Nosferican wants to merge 2 commits intoJuliaTime:masterfrom
Nosferican:conversions
Open
Draft for updating conversions#224Nosferican wants to merge 2 commits intoJuliaTime:masterfrom Nosferican:conversions
Nosferican wants to merge 2 commits intoJuliaTime:masterfrom
Nosferican:conversions
Conversation
This PR modifies the undocumented/not exported zoned flavored conversions to methods expanding the Dates API to just work with the ZonedDateTime.
Contributor
Author
|
Issue with building Julia 1.3 with Win unrelated (JuliaLang/julia#33470). |
Contributor
Author
|
Tests should be passing now with the release of Julia 1.3-RC4. It needs a re-trigger. |
Contributor
Author
|
Bump. |
omus
reviewed
Oct 20, 2019
| function zdt2julian(zdt::ZonedDateTime) | ||
| datetime2julian(utc(zdt)) | ||
| end | ||
| datetime2julian(zdt::ZonedDateTime) = datetime2julian(utc(zdt)) |
Member
There was a problem hiding this comment.
My preference would be to extend via:
Suggested change
| datetime2julian(zdt::ZonedDateTime) = datetime2julian(utc(zdt)) | |
| Dates.datetime2julian(zdt::ZonedDateTime) = datetime2julian(utc(zdt)) |
The rest of this package extends this way so I'd like to keep it consistent
|
|
||
| function zdt2julian(::Type{T}, zdt::ZonedDateTime) where T<:Integer | ||
| floor(T, datetime2julian(utc(zdt))) | ||
| end |
Member
There was a problem hiding this comment.
Deprecations need to be added for all of the removed functions
| function unix2zdt(seconds::Real) | ||
| ZonedDateTime(unix2datetime(seconds), utc_tz, from_utc=true) | ||
| end | ||
| unix2datetime(::Type{<:ZonedDateTime}, seconds::Real) = ZonedDateTime(unix2datetime(seconds), utc_tz, from_utc=true) |
Member
There was a problem hiding this comment.
It would be good to keep the line length to 92
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extending functions rather than undocumented new ones.