Ensure no zero-padding is used in the HHMM portion of version strings

This commit is contained in:
Steve Purcell 2012-09-01 15:37:26 +01:00
parent 7e888980b9
commit 84f54dd5fe

View file

@ -68,12 +68,16 @@
;;; Internal functions
(defun pb/parse-time (str)
"Parse STR as a time, and format as a YYYYMMDD string."
"Parse STR as a time, and format as a YYYYMMDD.HHMM string."
(message (format "%s\n" (substring-no-properties str)))
(format-time-string
"%Y%m%d.%H%M"
(date-to-time
(substring-no-properties str))))
;; We remove zero-padding the HH portion, as it is lost
;; when stored in the archive-contents
(replace-regexp-in-string "\\.0"
"."
(format-time-string
"%Y%m%d.%H%M"
(date-to-time
(substring-no-properties str)))))
(defun pb/string-match-all (regex str &optional group)
"Find every match for `REGEX' within `STR', returning the full match string or group `GROUP'."