From 03d39102ba55cda7cbe80fcdeb9b250caaa70bd0 Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 6 Jan 2020 10:28:27 +0100 Subject: compiler: properly reject invalid dates in sidecar files GitHub: closes #31 --- compiler/src/Input.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler/src/Input.hs') diff --git a/compiler/src/Input.hs b/compiler/src/Input.hs index 86d3ec8..85c802e 100644 --- a/compiler/src/Input.hs +++ b/compiler/src/Input.hs @@ -30,6 +30,7 @@ import Data.Function ((&)) import Data.Maybe (catMaybes) import Data.Bool (bool) import Data.List (find) +import Data.Time.LocalTime (ZonedTime) import Data.Yaml (ParseException, decodeFileEither) import Data.Aeson (FromJSON) import System.FilePath (isExtensionOf, dropExtension) @@ -60,7 +61,7 @@ data InputTree = data Sidecar = Sidecar { title :: Maybe String - , date :: Maybe String + , date :: Maybe ZonedTime , description :: Maybe String , tags :: Maybe [String] } deriving (Generic, FromJSON, Show) -- cgit v1.2.3