summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2009-10-08 17:19:37 +0200
committerMatthias Benkard <code@mail.matthias.benkard.de>2009-10-08 17:19:37 +0200
commit9f42220b6816b200b217c7bf30d758653136f3b3 (patch)
tree9d2a8f892d21686e50a669d104530f24a81c0c5a
parentf41b615110cb9acc5327cec81a96efdecd3e20d9 (diff)
Simplifications.
Ignore-this: 11065dcb0a018f50522827fd3e80f161 darcs-hash:f17d99384ad8fa4f68314f605383f6231fb092a0
-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))