1
0
Fork 0

- prefixed all parsing rule for date formatting to avoid clash with other rules in the code.

This commit is contained in:
cage 2024-06-19 15:52:54 +02:00
parent 74c78adc6a
commit 1e3854989b
1 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@
;; FIELD := [%hour %minute %second %month %year %day %weekday %%] ;; FIELD := [%hour %minute %second %month %year %day %weekday %%]
;; TEXT := (not percent)+ ;; TEXT := (not percent)+
(defrule field (defrule date-formatter-field
(or "%hour" (or "%hour"
"%min" "%min"
"%second" "%second"
@ -35,10 +35,10 @@
"%%") "%%")
(:text t)) (:text t))
(defrule text (+ (not percent)) (defrule date-formatter-text (+ (not date-formatter-percent))
(:text t)) (:text t))
(defrule format (* (or field text))) (defrule date-formatter-format (* (or date-formatter-field date-formatter-text)))
(defun expand-date-formatter-spec (spec) (defun expand-date-formatter-spec (spec)
"Expand a date spec like '%year %short-month %day %hour:%min' "Expand a date spec like '%year %short-month %day %hour:%min'