mirror of
https://github.com/prometheus/alertmanager
synced 2025-01-09 23:39:36 +00:00
Update date util func
This commit is contained in:
parent
cfeebbf560
commit
a055108cdf
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user