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
Since the Datetime is YYYY-MM-DD HH-MM-SS, there is no easy way to extract the week of the year. The Time data type (nanoseconds since the epoch) is considered canonical in this library, and any human-friendly presentation of it should first convert it to some other type and then encode that.
That aside, all the week-of-year stuff is missing because I just never needed it. The API would look something like this:
data YearWeek = YearWeek
{ yearWeekYear :: !Int64
, yearWeekWeek :: !Int -- should be less than 53 (or 54?)
}
timeToYearWeek :: Time -> YearWeek
And then various encodeYearWeek functions are possible but not necessary. If you or anyone else wants to add this, I'd take a PR.
I can't find an API to obtain week-of-year from a Datetime, is it intended so or missing by accident?
The text was updated successfully, but these errors were encountered: