The human part of Date.
With the 0.19 release, the core Date module has ceased to be. elm/time was introduced as a replacement. However, as part of its mission statement, Time says:
So to show a human being a time, you must always know the POSIX time and their
time zone. That is it. So all that “human time” stuff is for yourviewfunction,
not yourModel.
A simple use case: the DatePicker
I’m trying to build a datepicker module. This module produces as an output the human understanding of what a Date means. While the late Date was not perfect, it offered the ability to manipulate human models for dates. However, the new Time library doesn’t really help: given a year, month and day, it doesn’t define a single representation of what a day means.
A standard way of expressing time as humans understand it.
A Day is the combination of a year, month and day of month (i.e. 2018-08-28). An example use case of this is “May 1st is worker’s day”. This kind of logic can not be expressed simply with Posix.
An Hour is the hour of the day, in whatever timezone the user fancies (i.e. 18:55:00). An example use case of this is “I don’t want to be called between 00:00:00 and 09:00:00”, independently from my timezone. This kind of logic can not be expressed simply with Posix.
A Date is a Day and an Hour.
Time zones are a tool to go back and forth between two bounded contexts: absolute time, as defined by Posix, and the human perception of time. Each bounded context can be used separately. Without this second bounded context, making programs that play nicely with human constraints about time is hard.
These two types need to be standard, because date manipulation is a frequent topic in programs. It is important that modules manipulating these concepts do not define their own, incompatible representations. Otherwise, we would be left with people using A.Date unable to use B.Date.Extra or C.Date.ToPosix.
I hope I have brought enough evidence that “human time” is needed for more than merely view concerns.

