From f1ffff03ad6bf86c32c3af90393bd53ca21ad4db Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 6 Jan 2020 11:05:18 +0100 Subject: compiler: rename date field to more explicit datetime --- compiler/src/Input.hs | 4 ++-- compiler/src/Resource.hs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'compiler/src') diff --git a/compiler/src/Input.hs b/compiler/src/Input.hs index 85c802e..95d8132 100644 --- a/compiler/src/Input.hs +++ b/compiler/src/Input.hs @@ -61,7 +61,7 @@ data InputTree = data Sidecar = Sidecar { title :: Maybe String - , date :: Maybe ZonedTime + , datetime :: Maybe ZonedTime , description :: Maybe String , tags :: Maybe [String] } deriving (Generic, FromJSON, Show) @@ -69,7 +69,7 @@ data Sidecar = Sidecar emptySidecar :: Sidecar emptySidecar = Sidecar { title = Nothing - , date = Nothing + , datetime = Nothing , description = Nothing , tags = Nothing } diff --git a/compiler/src/Resource.hs b/compiler/src/Resource.hs index 53d61ac..29906b7 100644 --- a/compiler/src/Resource.hs +++ b/compiler/src/Resource.hs @@ -78,7 +78,7 @@ instance ToJSON GalleryItemProps where data GalleryItem = GalleryItem { title :: String - , date :: ZonedTime + , datetime :: ZonedTime , description :: String , tags :: [Tag] , path :: Path @@ -109,7 +109,7 @@ buildGalleryTree processItem processThumbnail tagsFromDirectories galleryName in fileModTime <- lastModTime path return GalleryItem { title = itemTitle - , date = fromMaybe fileModTime $ Input.date sidecar + , datetime = fromMaybe fileModTime $ Input.datetime sidecar , description = optMeta description "" , tags = (optMeta tags []) ++ implicitParentTags parents , path = parents Maybe ZonedTime mostRecentChildModTime = - maximumByMay comparingDates . map (date::(GalleryItem -> ZonedTime)) + maximumByMay comparingTime . map (datetime::(GalleryItem -> ZonedTime)) - comparingDates :: ZonedTime -> ZonedTime -> Ordering - comparingDates l r = compare (zonedTimeToUTC l) (zonedTimeToUTC r) + comparingTime :: ZonedTime -> ZonedTime -> Ordering + comparingTime l r = compare (zonedTimeToUTC l) (zonedTimeToUTC r) aggregateChildTags :: [GalleryItem] -> [Tag] aggregateChildTags = unique . concatMap (\item -> tags (item::GalleryItem)) -- cgit v1.2.3