Change date format from YYYY-MM-DD to DD-MM-YYYY

This commit is contained in:
Patrick Winter 2019-11-07 19:24:21 +01:00
parent 3e5dea2aaf
commit 2a74bc57af
2 changed files with 7 additions and 5 deletions

View file

@ -483,10 +483,12 @@
(minute (elt time 1)) (minute (elt time 1))
(second (elt time 2))) (second (elt time 2)))
(cond (cond
((eq timestamp nil)
nil)
((eq format :date) ((eq format :date)
(format "%s-%s-%s" day month year hour minute second)) (format "%s-%s-%s" year month day hour minute second))
((eq format :datetime) ((eq format :datetime)
(format "%s-%s-%s %s:%s:%s" day month year hour minute second))))) (format "%s-%s-%s %s:%s:%s" year month day hour minute second)))))
(provide 'taskwarrior) (provide 'taskwarrior)

View file

@ -24,9 +24,9 @@
(should (string= (taskwarrior--parse-created-task-id "Some invalid input") nil))) (should (string= (taskwarrior--parse-created-task-id "Some invalid input") nil)))
(ert-deftest taskwarrior--parse-date () (ert-deftest taskwarrior--parse-date ()
(should (string= (taskwarrior--parse-date "20191108T225959Z") "08-11-2019")) (should (string= (taskwarrior--parse-date "20191108T225959Z") "2019-11-08"))
(should (string= (taskwarrior--parse-date "20191108T225959Z" :date) "08-11-2019")) (should (string= (taskwarrior--parse-date "20191108T225959Z" :date) "2019-11-08"))
(should (string= (taskwarrior--parse-date "20191108T225959Z" :datetime) "08-11-2019 22:59:59"))) (should (string= (taskwarrior--parse-date "20191108T225959Z" :datetime) "2019-11-08 22:59:59")))
(provide 'taskwarrior-test) (provide 'taskwarrior-test)