interval-type->seconds returns incorrect values
Closed this issue · 1 comments
webx007 commented
The function interval-type->seconds returns incorrect values for hours, days, weeks, months and years. The alist containing the unit in seconds for the above time units are all missing a zero.
This also needs to be corrected for the unit tests. Corrected below:
(defun interval-type->seconds (interval-type) (cdr (assoc interval-type '((second . 1) (seconds . 1) (minute . 60) (minutes . 60) (hour . 3600) (hours . 3600) (day . 86400) (days . 86400) (week . 604800) (weeks . 604800) (month . 2419200) (months . 2419200) ;; years are (* days 365) ;; regardless if the current year is ;; a leap year (year . 31536000) (years . 31536000)) :test #'string=)))
BnMcGn commented
Thanks. Will have a look at it.