Bläddra i källkod

Merge branch 'master' into feat/web-bi-client

charlie 2 år sedan
förälder
incheckning
ac718a6591
2 ändrade filer med 3 tillägg och 1 borttagningar
  1. 2 0
      src/main/frontend/date.cljs
  2. 1 1
      src/main/frontend/modules/file/core.cljs

+ 2 - 0
src/main/frontend/date.cljs

@@ -155,6 +155,7 @@
 
 (defn normalize-journal-title
   "Normalize journal title at best effort. Return nil if title is not a valid date.
+   Return goog.date.Date.
 
    Return format: 20220812T000000"
   [title]
@@ -202,6 +203,7 @@
     (journal-title-> journal-title #(tf/unparse formatter %))))
 
 (defn date->file-name
+  "Date object to filename format"
   [date]
   (let [formatter (if-let [format (state/get-journal-file-name-format)]
                     (tf/formatter format)

+ 1 - 1
src/main/frontend/modules/file/core.cljs

@@ -122,7 +122,7 @@
           whiteboard-page? (model/whiteboard-page? page-block)
           format (if whiteboard-page? "edn" format)
           journal-page? (date/valid-journal-title? title)
-          journal-title (date/journal-title->custom-format title)
+          journal-title (date/normalize-journal-title title)
           journal-page? (and journal-page? (not (string/blank? journal-title)))
           filename (if journal-page?
                      (date/date->file-name journal-title)