From 5c682314db0e6220e11b8bd0581b83186082c46e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8jberg?= Date: Tue, 15 Aug 2023 11:14:31 -0400 Subject: [PATCH] Fix DateTime.fromString --- src/UI/DateTime.elm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/UI/DateTime.elm b/src/UI/DateTime.elm index a9b92a88..d2b7dcf7 100644 --- a/src/UI/DateTime.elm +++ b/src/UI/DateTime.elm @@ -5,8 +5,8 @@ module UI.DateTime exposing ( DateTime , DateTimeFormat(..) , decode + , fromISO8601 , fromPosix - , fromString , isSameDay , toISO8601 , toPosix @@ -55,10 +55,11 @@ decode = Decode.map DateTime Iso8601.decoder -fromString : String -> Maybe DateTime -fromString s = +fromISO8601 : String -> Maybe DateTime +fromISO8601 s = s - |> Decode.decodeString decode + |> Iso8601.toTime + |> Result.map DateTime |> Result.toMaybe