File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed
common/src/logseq/common/util Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 100
100
(defn ms->journal-day
101
101
" Converts a milliseconds timestamp to the nearest :block/journal-day"
102
102
[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))
Original file line number Diff line number Diff line change 322
322
:block/uuid (common-uuid/gen-uuid :journal-page-uuid date-int)
323
323
:block/journal-day date-int)))
324
324
(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 )]
326
327
{:block
327
328
(-> block
328
- (assoc :logseq.task/deadline time-long)
329
+ (assoc datetime-property time-long)
329
330
(dissoc :block/deadline :block/scheduled :block/repeated? ))
330
331
:properties-tx (when-not existing-journal-page [deadline-page])})
331
332
{:block block :properties-tx []}))
Original file line number Diff line number Diff line change 304
304
305
305
(is (= 20221125
306
306
(-> (readable-properties @conn (db-test/find-block-by-content @conn " only scheduled" ))
307
- :logseq.task/deadline
307
+ :logseq.task/scheduled
308
308
date-time-util/ms->journal-day))
309
309
" scheduled block converted to correct deadline" )
310
310
You can’t perform that action at this time.
0 commit comments