aboutsummaryrefslogtreecommitdiff
path: root/src/client/View/Date.elm
blob: c96e99e8013c716ce1a2e4f0d55d52c3abe62d56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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"