Skip to content

Commit 2a4f49e

Browse files
enhance: importer can import :logseq.task/scheduled
Follow up to #11654. Fixes https://test.logseq.com/#/page/677d36f0-5d8f-4b82-85ad-486d81a46e7e
1 parent 03592a2 commit 2a4f49e

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

deps/common/src/logseq/common/util/date_time.cljs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@
100100
(defn ms->journal-day
101101
"Converts a milliseconds timestamp to the nearest :block/journal-day"
102102
[ms]
103-
(->> ms
104-
tc/from-long
105-
t/to-default-time-zone
106-
(tf/unparse (tf/formatter "yyyyMMdd"))
107-
parse-long))
103+
(some->> ms
104+
tc/from-long
105+
t/to-default-time-zone
106+
(tf/unparse (tf/formatter "yyyyMMdd"))
107+
parse-long))

deps/graph-parser/src/logseq/graph_parser/exporter.cljs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,11 @@
322322
:block/uuid (common-uuid/gen-uuid :journal-page-uuid date-int)
323323
:block/journal-day date-int)))
324324
(assoc :block/tags #{:logseq.class/Journal}))
325-
time-long (tc/to-long (date-time-util/int->local-date date-int))]
325+
time-long (tc/to-long (date-time-util/int->local-date date-int))
326+
datetime-property (if (:block/deadline block) :logseq.task/deadline :logseq.task/scheduled)]
326327
{:block
327328
(-> block
328-
(assoc :logseq.task/deadline time-long)
329+
(assoc datetime-property time-long)
329330
(dissoc :block/deadline :block/scheduled :block/repeated?))
330331
:properties-tx (when-not existing-journal-page [deadline-page])})
331332
{:block block :properties-tx []}))

deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304

305305
(is (= 20221125
306306
(-> (readable-properties @conn (db-test/find-block-by-content @conn "only scheduled"))
307-
:logseq.task/deadline
307+
:logseq.task/scheduled
308308
date-time-util/ms->journal-day))
309309
"scheduled block converted to correct deadline")
310310

0 commit comments

Comments
 (0)