diff options
author | Joris Guyonvarch | 2015-08-14 09:23:12 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-08-14 09:23:12 +0200 |
commit | d25b857d8317d729995d6aa25db7a83fe92a07ef (patch) | |
tree | cbd329ea073e3089e67d7faea61b4b25361b0e68 /src/client/View/Date.elm | |
parent | e98879d01b3b427a161d70535a30b2f848400607 (diff) |
Translating dates
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" |