diff options
Diffstat (limited to 'src/client/View/Date.elm')
-rw-r--r-- | src/client/View/Date.elm | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/client/View/Date.elm b/src/client/View/Date.elm new file mode 100644 index 0000000..c96e99e --- /dev/null +++ b/src/client/View/Date.elm @@ -0,0 +1,32 @@ +module View.Date + ( renderDate + ) where + +import Date exposing (..) + +import Model.Translations exposing (..) + +renderDate : Date -> Translations -> String +renderDate date translations = + let params = + [ toString (Date.day date) + , (getMessage (getMonthKey (Date.month date)) translations) + , toString (Date.year date) + ] + in getVarMessage params "Date" translations + +getMonthKey : Month -> String +getMonthKey month = + case month of + Jan -> "January" + Feb -> "February" + Mar -> "March" + Apr -> "April" + May -> "May" + Jun -> "June" + Jul -> "July" + Aug -> "August" + Sep -> "September" + Oct -> "October" + Nov -> "November" + Dec -> "December" |