|
@@ -21,8 +21,8 @@
|
|
([input current-block-uuid]
|
|
([input current-block-uuid]
|
|
(cond
|
|
(cond
|
|
(= :right-now-ms input) (util/time-ms)
|
|
(= :right-now-ms input) (util/time-ms)
|
|
- (= :start-of-today-ms input) (util/date-at-local-ms 0 0 0 0)
|
|
|
|
- (= :end-of-today-ms input) (util/date-at-local-ms 24 0 0 0)
|
|
|
|
|
|
+ (= :start-of-today-ms input) (util/today-at-local-ms 0 0 0 0)
|
|
|
|
+ (= :end-of-today-ms input) (util/today-at-local-ms 24 0 0 0)
|
|
|
|
|
|
(= :today input)
|
|
(= :today input)
|
|
(date->int (t/today))
|
|
(date->int (t/today))
|
|
@@ -38,34 +38,22 @@
|
|
(:db/id (db-utils/entity [:block/uuid current-block-uuid]))
|
|
(:db/id (db-utils/entity [:block/uuid current-block-uuid]))
|
|
(and current-block-uuid (= :parent-block input))
|
|
(and current-block-uuid (= :parent-block input))
|
|
(:db/id (model/get-block-parent current-block-uuid))
|
|
(:db/id (model/get-block-parent current-block-uuid))
|
|
- ;; :3d-before-ms
|
|
|
|
- (and (keyword? input)
|
|
|
|
- (re-find #"^\d+d(-before-ms)?$" (name input)))
|
|
|
|
- (let [input (name input)
|
|
|
|
- days (parse-long (re-find #"^\d+" input))]
|
|
|
|
- (util/date-at-local-ms (t/minus (t/today) (t/days days)) 0 0 0 0))
|
|
|
|
- ;; :3d-after-ms
|
|
|
|
- (and (keyword? input)
|
|
|
|
- (re-find #"^\d+d(-after-ms)?$" (name input)))
|
|
|
|
- (let [input (name input)
|
|
|
|
- days (parse-long (re-find #"^\d+" input))]
|
|
|
|
- (util/date-at-local-ms (t/plus (t/today) (t/days days)) 24 0 0 0))
|
|
|
|
- ;; :3d-before
|
|
|
|
|
|
+ ;; e.g. :3d-before
|
|
(and (keyword? input)
|
|
(and (keyword? input)
|
|
(re-find #"^\d+d(-before)?$" (name input)))
|
|
(re-find #"^\d+d(-before)?$" (name input)))
|
|
(let [input (name input)
|
|
(let [input (name input)
|
|
days (parse-long (re-find #"^\d+" input))]
|
|
days (parse-long (re-find #"^\d+" input))]
|
|
(date->int (t/minus (t/today) (t/days days))))
|
|
(date->int (t/minus (t/today) (t/days days))))
|
|
- ;; :3d-after
|
|
|
|
|
|
+ ;; e.g. :3d-after
|
|
(and (keyword? input)
|
|
(and (keyword? input)
|
|
(re-find #"^\d+d(-after)?$" (name input)))
|
|
(re-find #"^\d+d(-after)?$" (name input)))
|
|
(let [input (name input)
|
|
(let [input (name input)
|
|
days (parse-long (re-find #"^\d+" input))]
|
|
days (parse-long (re-find #"^\d+" input))]
|
|
(date->int (t/plus (t/today) (t/days days))))
|
|
(date->int (t/plus (t/today) (t/days days))))
|
|
|
|
|
|
- (and (string? input) (page-ref/page-ref? input))
|
|
|
|
- (-> (page-ref/get-page-name input)
|
|
|
|
- (string/lower-case))
|
|
|
|
|
|
+ (and (string? input) (page-ref/page-ref? input))
|
|
|
|
+ (-> (page-ref/get-page-name input)
|
|
|
|
+ (string/lower-case))
|
|
|
|
|
|
:else
|
|
:else
|
|
input)))
|
|
input)))
|