Here is an example of using the DateTimeOptions
with and without the helper functions (in a response to keep the main post concise):
- year, month, day:
{ defaultDateTimeOptions
| year = Just Numeric
, month = Just (Text Short)
, day = Just Numeric
}
defaultDateTimeOptions
|> setYear Numeric
|> setMonthNumber Short
|> setDay Numeric
As you can see, both versions are about equally verbose. The advantage of the helper functions is that you can avoid writing Just
over and over, and can choose the correct Month helper function. The disadvantage is bloat in the API.