mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 19:06:21 +00:00
fix: can't restore page's name if it includes reserved characters
Also, fixed issues related to renaming pages
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
(when-let [formatter-string (state/get-date-formatter)]
|
||||
(tf/unparse (tf/formatter formatter-string) date)))
|
||||
|
||||
(def custom-formatter (tf/formatter "yyyy-MM-dd HH:mm:ssZ"))
|
||||
(def custom-formatter (tf/formatter "yyyy-MM-dd'T'HH:mm:ssZZ"))
|
||||
|
||||
(defn journal-title-formatters
|
||||
[]
|
||||
@@ -44,8 +44,24 @@
|
||||
"yyyy年MM月dd日"}
|
||||
(state/get-date-formatter)))
|
||||
|
||||
(defn get-date-time-string [date-time]
|
||||
(tf/unparse custom-formatter date-time))
|
||||
(defn get-date-time-string
|
||||
([]
|
||||
(get-date-time-string (t/now)))
|
||||
([date-time]
|
||||
(tf/unparse custom-formatter date-time)))
|
||||
|
||||
(defn get-locale-string
|
||||
[s]
|
||||
(try
|
||||
(->> (tf/parse (tf/formatters :date-time-no-ms) s)
|
||||
(t/to-default-time-zone)
|
||||
(tf/unparse (tf/formatter "MMM do, yyyy")))
|
||||
(catch js/Error e
|
||||
nil)))
|
||||
|
||||
(defn ISO-string
|
||||
[]
|
||||
(.toISOString (js/Date.)))
|
||||
|
||||
(defn get-local-date-time-string
|
||||
[]
|
||||
|
||||
Reference in New Issue
Block a user