Update date util func

This commit is contained in:
stuart nelson 2017-01-04 18:02:38 -05:00
parent cfeebbf560
commit a055108cdf

View File

@ -5,38 +5,51 @@ import Date exposing (Month(..))
dateFormat : Date.Date -> String
dateFormat date =
let
time = String.join ":" <| List.map toString [Date.hour date, Date.minute date, Date.second date]
d = String.join "/" <| List.map toString [dateToInt <| Date.month date, Date.day date, Date.year date]
in
String.join " " ["Since", d, "at", time]
let
time =
String.join ":" <| List.map toString [ Date.hour date, Date.minute date, Date.second date ]
d =
String.join "/" <| List.map toString [ dateToInt <| Date.month date, Date.day date, Date.year date ]
in
d
dateToInt : Date.Month -> Int
dateToInt month =
case month of
Jan ->
1
Feb ->
2
Mar ->
3
Apr ->
4
May ->
5
Jun ->
6
Jul ->
7
Aug ->
8
Sep ->
9
Oct ->
10
Nov ->
11
Dec ->
12
case month of
Jan ->
1
Feb ->
2
Mar ->
3
Apr ->
4
May ->
5
Jun ->
6
Jul ->
7
Aug ->
8
Sep ->
9
Oct ->
10
Nov ->
11
Dec ->
12