summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils.lisp38
1 files changed, 18 insertions, 20 deletions
diff --git a/utils.lisp b/utils.lisp
index fab371a..574d9f2 100644
--- a/utils.lisp
+++ b/utils.lisp
@@ -115,31 +115,29 @@ after another in any arbitrary order."
(if time-zone-supplied-p
(decode-universal-time universal-time time-zone)
(decode-universal-time universal-time))
- (let ((first-match-p t)
- (last-match-end 0))
+ (let ((last-match-end 0))
(ppcre:do-matches (start end "%[^%]*%" date-control-string)
(let ((substring (subseq date-control-string (1+ start) (1- end))))
(format out (subseq date-control-string last-match-end start))
- (multiple-value-bind (control value offset)
+ (multiple-value-bind (control value)
(literal-casequal substring
- ("day-of-week" (values "~D" day-of-week 11))
+ ("day-of-week" (values "~D" day-of-week))
("@day-of-week" (values "~A"
- (name-of-day day-of-week)
- 12))
- ("daylight-p" (values "~A" daylight-p 10))
- ("zone" (values "~D" zone 4))
- ("day" (values "~D" day 3))
- ("mon" (values "~D" mon 3))
- ("yr" (values "~D" yr 2))
- ("sec" (values "~D" sec 3))
- ("min" (values "~D" min 3))
- ("hr" (values "~D" hr 2))
- ("2day" (values "~2,'0D" day 4))
- ("2mon" (values "~2,'0D" mon 4))
- ("4yr" (values "~4,'0D" yr 3))
- ("2sec" (values "~2,'0D" sec 4))
- ("2min" (values "~2,'0D" min 4))
- ("2hr" (values "~2,'0D" hr 3)))
+ (name-of-day day-of-week)))
+ ("daylight-p" (values "~A" daylight-p))
+ ("zone" (values "~D" zone))
+ ("day" (values "~D" day))
+ ("mon" (values "~D" mon))
+ ("yr" (values "~D" yr))
+ ("sec" (values "~D" sec))
+ ("min" (values "~D" min))
+ ("hr" (values "~D" hr))
+ ("2day" (values "~2,'0D" day))
+ ("2mon" (values "~2,'0D" mon))
+ ("4yr" (values "~4,'0D" yr))
+ ("2sec" (values "~2,'0D" sec))
+ ("2min" (values "~2,'0D" min))
+ ("2hr" (values "~2,'0D" hr)))
(if control
(format out control value)
(format out "%~A%" substring))