Open
Description
Hi,
It would be nice if functions for formatting Date
and Time
types exist. Currently, if one wants to format a Date
, a dummy Time
value needs to be be created to convert to a DateTime
for formatting; likewise for the Time
type.
I'm not exactly sure what the best way to do this would be. Maybe:
data PlacholderFormatterCommand = Placeholder String
data DateFormatterCommand
= YearFull
| YearTwoDigits
| YearAbsolute
| MonthFull
[...]
| PlaceholderFormatterCommand
data TimeFormatterCommand
= [...]
| PlaceholderFormatterCommand
data DateTimeFormatterCommand
= DateFormatterCommand
| TimeFormatterCommand
The main issue I see with this approach are FormatterCommands
that are applicable to both Date
s and Time
s, namely Placeholder
and UnixTimestamp
. Maybe there is a more elegant solution involving type classes?