Properly format dates as ISO YYYY-MM-DD HH:MM:SS

This commit is contained in:
Jai Flack 2022-03-24 23:27:33 +10:00
parent 3b4476ab68
commit ed2d9f6348
No known key found for this signature in database
GPG key ID: B0073AB365D0807D

View file

@ -140,12 +140,19 @@ This can also be set per-server."
(nth (1- m) gnus-english-month-names)) (nth (1- m) gnus-english-month-names))
(`(nil nil ,y) (`(nil nil ,y)
(number-to-string y)) (number-to-string y))
;; mu prefers ISO date YYYY-MM-DD HH:MM:SS
(`(,d ,m nil) (`(,d ,m nil)
(format "%02d-%02d" d m)) (let* ((ct (decode-time))
(cm (decoded-time-month ct))
(cy (decoded-time-year ct))
(y (if (> cm m)
cy
(1- cy))))
(format "%d-%02d-%02d" y m d)))
(`(nil ,m ,y) (`(nil ,m ,y)
(format "%02d-%02d" m y)) (format "%d-%02d" y m))
(`(,d ,m ,y) (`(,d ,m ,y)
(format "%d/%d/%d" m d y)))))) (format "%d-%02d-%02d" y m d))))))
(cond (cond
((consp (car expr)) ((consp (car expr))
(format "(%s)" (gnus-search-transform engine expr))) (format "(%s)" (gnus-search-transform engine expr)))