diff options
author | pacien | 2020-01-06 10:28:27 +0100 |
---|---|---|
committer | pacien | 2020-01-06 10:28:27 +0100 |
commit | 03d39102ba55cda7cbe80fcdeb9b250caaa70bd0 (patch) | |
tree | 679a36e4b5eaa9c49bb62b715772d96bd9a26aaa /compiler/src/Input.hs | |
parent | 5f57fd4f21f7ecd4038ca6e66a4b89622cbcc9fc (diff) | |
download | ldgallery-03d39102ba55cda7cbe80fcdeb9b250caaa70bd0.tar.gz |
compiler: properly reject invalid dates in sidecar files
GitHub: closes #31
Diffstat (limited to 'compiler/src/Input.hs')
-rw-r--r-- | compiler/src/Input.hs | 3 |
1 files changed, 2 insertions, 1 deletions
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 ((&)) | |||
30 | import Data.Maybe (catMaybes) | 30 | import Data.Maybe (catMaybes) |
31 | import Data.Bool (bool) | 31 | import Data.Bool (bool) |
32 | import Data.List (find) | 32 | import Data.List (find) |
33 | import Data.Time.LocalTime (ZonedTime) | ||
33 | import Data.Yaml (ParseException, decodeFileEither) | 34 | import Data.Yaml (ParseException, decodeFileEither) |
34 | import Data.Aeson (FromJSON) | 35 | import Data.Aeson (FromJSON) |
35 | import System.FilePath (isExtensionOf, dropExtension) | 36 | import System.FilePath (isExtensionOf, dropExtension) |
@@ -60,7 +61,7 @@ data InputTree = | |||
60 | 61 | ||
61 | data Sidecar = Sidecar | 62 | data Sidecar = Sidecar |
62 | { title :: Maybe String | 63 | { title :: Maybe String |
63 | , date :: Maybe String | 64 | , date :: Maybe ZonedTime |
64 | , description :: Maybe String | 65 | , description :: Maybe String |
65 | , tags :: Maybe [String] | 66 | , tags :: Maybe [String] |
66 | } deriving (Generic, FromJSON, Show) | 67 | } deriving (Generic, FromJSON, Show) |