mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
fix: some date related issues
This commit is contained in:
@@ -99,7 +99,7 @@
|
||||
:old-title "aa?#.bbb.ccc",
|
||||
:changed-title "aa?#/bbb/ccc"}))
|
||||
|
||||
(deftest rename-tests
|
||||
(deftest rename-tests-l2t
|
||||
;; z: new title structure; x: old ver title; y: title property (if available)
|
||||
(are [x y z] (= z (#'conversion-handler/calc-rename-target-impl :legacy :triple-lowbar x y))
|
||||
"aaBBcc" "aabbcc" nil
|
||||
@@ -137,6 +137,10 @@
|
||||
:target "adbcde___aks___sdf",
|
||||
:old-title "adbcde/aks/sdf",
|
||||
:changed-title "adbcde/aks/sdf"}
|
||||
"aaa%2Fbbb%2Fccc" "aaa/bbb/ccc" {:status :informal,
|
||||
:target "aaa___bbb___ccc",
|
||||
:old-title "aaa/bbb/ccc",
|
||||
:changed-title "aaa/bbb/ccc"}
|
||||
"CON" "CON" {:status :informal,
|
||||
:target "CON___",
|
||||
:old-title "CON",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
(ns frontend.format.block-test
|
||||
(:require [cljs.test :refer [deftest testing are]]
|
||||
[frontend.format.block :as block]))
|
||||
[frontend.format.block :as block]
|
||||
[frontend.date :as date]))
|
||||
|
||||
(deftest test-normalize-date
|
||||
(testing "normalize date values"
|
||||
@@ -49,3 +50,23 @@
|
||||
|
||||
"-%"
|
||||
"-%")))
|
||||
|
||||
(deftest test-normalize-journal-title
|
||||
(testing "normalize journal titles"
|
||||
(are [x y] (let [f #(-> % date/normalize-journal-title str)]
|
||||
(= (f x) y))
|
||||
"Aug 12th, 2022"
|
||||
"20220812T000000"
|
||||
|
||||
"2022-08-12"
|
||||
"20220812T000000"
|
||||
|
||||
"2022-10"
|
||||
""
|
||||
|
||||
"2022Q4"
|
||||
""
|
||||
|
||||
"2022-08"
|
||||
"")))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user