Format dates the way that God intended

This commit is contained in:
Ryan Fox 2021-01-11 22:55:40 +00:00
parent 5a3ef2f83e
commit da0358b9ea
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E

View File

@ -14,7 +14,7 @@ module View.Common
)
import Date
import Date.Extra.Config.Config_en_au as DateEn
import Date.Extra.Config.Config_en_us as DateEn
import Date.Extra.Format as DateFormat
import Html exposing (..)
import Html.Attributes exposing (..)
@ -178,4 +178,4 @@ formatDate : String -> String
formatDate dateString =
Date.fromString dateString
|> Result.withDefault (Date.fromTime 0)
|> DateFormat.format DateEn.config "%d/%m/%Y %H:%M"
|> DateFormat.format DateEn.config "%Y-%m-%d %H:%M"