You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use DateTimeOffset for everything instead of regular DateTime since it maintains time zone information. Right now we have to |> List.map (fun datetimeoffset -> datetimeoffset.UtcDateTime) every time we chart up something.
Would it be possible to support DateTimeOffset directly?
The problem here is DateTimeOffset not implementing IConvertible while DateTime does. For me it seems like we would not really have much of a choice here other than implementing overloads for every single chart function on DateTimeOffset for that to work, which seems quite overkill for a use case that can be solved with a single mapping/conversion step. Implementing IConvertible for DateTimeOffset also seems to be not that trivial and might also be overkill on your side, so i am afraid I do not have any good idea to tackle this from our side atm. There might be a solution coming up though, depending on when and if erased union types become a thing in F#.
Aha. That makes sense. Yeah implementing overloads for every method seems like tedious work when everything else works fine with just IConvertible. I guess the best workaround for now is for us to make some helpers that converts a list of DateTimeOffset to DateTime.
Cloosing for now, might be revisited when erased unions are a thing in F# so we could use things like (IConvertible|DateTimeOffset|SomeOtherType) as input
Activity
kMutagene commentedon Apr 11, 2021
Hi @drhumlen,
The problem here is
DateTimeOffsetnot implementingIConvertiblewhileDateTimedoes. For me it seems like we would not really have much of a choice here other than implementing overloads for every single chart function onDateTimeOffsetfor that to work, which seems quite overkill for a use case that can be solved with a single mapping/conversion step. ImplementingIConvertibleforDateTimeOffsetalso seems to be not that trivial and might also be overkill on your side, so i am afraid I do not have any good idea to tackle this from our side atm. There might be a solution coming up though, depending on when and if erased union types become a thing in F#.drhumlen commentedon Apr 12, 2021
Aha. That makes sense. Yeah implementing overloads for every method seems like tedious work when everything else works fine with just
IConvertible. I guess the best workaround for now is for us to make some helpers that converts a list of DateTimeOffset to DateTime.kMutagene commentedon Apr 13, 2021
Cloosing for now, might be revisited when erased unions are a thing in F# so we could use things like
(IConvertible|DateTimeOffset|SomeOtherType)as input