enhance: page adds timestamps && all pages

This commit is contained in:
Tienson Qin
2021-07-14 00:31:57 +08:00
parent ac1f68004a
commit e2a047c1ac
15 changed files with 314 additions and 188 deletions

View File

@@ -193,3 +193,23 @@
{:title page-name
;; :date (date/get-date-time-string)
})
(defn fix-pages-timestamps
[pages]
(map (fn [{:block/keys [name created-at updated-at journal-day] :as p}]
(cond->
p
(nil? created-at)
(assoc :block/created-at
(if journal-day
(date/journal-day->ts journal-day)
(util/time-ms)))
(nil? updated-at)
(assoc :block/updated-at
;; Not exact true
(if journal-day
(date/journal-day->ts journal-day)
(util/time-ms)))))
pages))