Display Silence and Alert dates in ISO8601 format (#2363)

* This changes the Alert view the SilenceList and SilenceView

Signed-off-by: Nicholas Capo <nicholas.capo@gmail.com>
This commit is contained in:
Nicholas Capo 2020-12-03 16:06:14 -06:00 committed by GitHub
parent 6c5dee008f
commit 193ebba04d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 70 deletions

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,6 @@ module Utils.Date exposing
, parseDuration
, term
, timeDifference
, timeFormat
, timeFromString
, timeToString
, units
@ -105,73 +104,8 @@ durationFormat duration =
dateTimeFormat : Posix -> String
dateTimeFormat time =
timeFormat time
++ ", "
++ String.fromInt (toYear utc time)
++ "-"
++ padWithZero (monthFormat (toMonth utc time))
++ "-"
++ padWithZero (toDay utc time)
++ " (UTC)"
timeFormat : Posix -> String
timeFormat time =
padWithZero (toHour utc time)
++ ":"
++ padWithZero (toMinute utc time)
++ ":"
++ padWithZero (toSecond utc time)
padWithZero : Int -> String
padWithZero n =
if n < 10 then
"0" ++ String.fromInt n
else
String.fromInt n
monthFormat : Month -> Int
monthFormat 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
dateTimeFormat =
Iso8601.fromTime
encode : Posix -> String