mirror of
https://github.com/logseq/logseq.git
synced 2026-04-27 23:54:55 +00:00
enhance: page adds timestamps && all pages
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user