-
Notifications
You must be signed in to change notification settings - Fork 54
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
Make ZonedDateTime parametric on timezone type #332
base: master
Are you sure you want to change the base?
Conversation
make explict that Type and StepRange are for any <:ZonedDataTime
Wow @omus was right, adding a type parameters really does break a lot of things. The other thing we should maybe do is add a format versions to the compiled dir file path. |
We need a promotion rule for different TimeZones.jl/src/types/zoneddatetime.jl Lines 163 to 165 in 906cea0
Though an alternative might be to all but if we don't have a proimotion rule the following happens: julia> [ZonedDateTime(Date(2000), tz"America/Winnipeg"), ZonedDateTime(Date(2001), tz"UTC")]
ERROR: no promotion exists for ZonedDateTime{VariableTimeZone} and ZonedDateTime{FixedTimeZone}
Stacktrace:
[1] error(::String, ::Type, ::String, ::Type)
@ Base ./error.jl:42
[2] promote_rule(#unused#::Type{ZonedDateTime{VariableTimeZone}}, #unused#::Type{ZonedDateTime{FixedTimeZone}})
@ TimeZones ~/JuliaEnvs/BidDatabase.jl/dev/TimeZones/src/types/zoneddatetime.jl:162
[3] promote_type
@ ./promotion.jl:233 [inlined]
[4] promote_typeof(x::ZonedDateTime{VariableTimeZone}, xs::ZonedDateTime{FixedTimeZone})
@ Base ./promotion.jl:272
[5] vect(::ZonedDateTime{VariableTimeZone}, ::Vararg{Any, N} where N)
@ Base ./array.jl:126
[6] top-level scope
@ REPL[18]:1 |
I'm definitely against converting the time zones automatically through promotion. I can see having heterogeneous A similar issue would also exist for: #318 |
Just a thought: what if we introduced a new alternative type to |
My current preferred solution is to introduce |
Relevant: invenia/Intervals.jl#178 (comment) |
This is just the parametric type bit from #324 (review)
Contirbutes to #271 once we sort out the timezone types