posixDateTask : Task.Task x Time.Date.Date
posixDateTask =
let
timeZoneDate now =
Time.Date.date
(Time.ZonedDateTime.year (Time.ZonedDateTime.fromDateTime (TimeZones.canada_pacific ()) now))
(Time.ZonedDateTime.month (Time.ZonedDateTime.fromDateTime (TimeZones.canada_pacific ()) now))
(Time.ZonedDateTime.day (Time.ZonedDateTime.fromDateTime (TimeZones.canada_pacific ()) now))
in
Time.now
|> Task.map timeZoneDate
This gives me an error:
|> Task.map timeZoneDate
(|>) is expecting the right side to be a:
Task.Task x Time.Time -> a
But the right side is:
Task.Task x Time.DateTime.DateTime -> Task.Task x Time.Date.Date
How should I change to return a Task.Task x Time.Date.Date
type.
I don't know where is the Time.DateTime.DateTime
come from.