mirror of
https://github.com/correl/melpa.git
synced 2024-11-22 19:18:39 +00:00
Ensure no zero-padding is used in the HHMM portion of version strings
This commit is contained in:
parent
7e888980b9
commit
84f54dd5fe
1 changed files with 9 additions and 5 deletions
|
@ -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'."
|
||||
|
|
Loading…
Reference in a new issue