mirror of
https://github.com/logseq/logseq.git
synced 2026-04-29 00:24:51 +00:00
refactor(ui): refactor all of the classical datepicker codes with the shui calendar
This commit is contained in:
@@ -18,13 +18,6 @@
|
||||
:repeater {}})
|
||||
(defonce *timestamp (atom default-timestamp-value))
|
||||
|
||||
(defn- date->goog-date
|
||||
[d]
|
||||
(cond
|
||||
(some->> d (instance? js/Date))
|
||||
(goog.date.Date. (.getFullYear d) (.getMonth d) (.getDate d))
|
||||
:else d))
|
||||
|
||||
(defonce *show-time? (atom false))
|
||||
(rum/defc time-input < rum/reactive
|
||||
[default-value]
|
||||
@@ -97,7 +90,7 @@
|
||||
[e]
|
||||
(when e (util/stop e))
|
||||
(let [{:keys [repeater] :as timestamp} @*timestamp
|
||||
date (-> (:date-picker/date @state/state) date->goog-date)
|
||||
date (-> (:date-picker/date @state/state) date/js-date->goog-date)
|
||||
timestamp (assoc timestamp :date (or date (t/today)))
|
||||
kind (if (= "w" (:duration repeater)) "++" ".+")
|
||||
timestamp (assoc-in timestamp [:repeater :kind] kind)
|
||||
|
||||
Reference in New Issue
Block a user