Commit 89719ce9 authored by Edward M. Reingold's avatar Edward M. Reingold
Browse files

Check for nil time before trying to adjust it for dst.

parent 98fd7017
......@@ -382,9 +382,9 @@ Format used is given by `calendar-time-display-form'."
(defun solar-sunrise-sunset (date)
"String giving local times of sunrise and sunset on Gregorian DATE."
(let* ((rise (solar-sunrise date))
(adj-rise (solar-adj-time-for-dst date rise))
(adj-rise (if rise (solar-adj-time-for-dst date rise)))
(set (solar-sunset date))
(adj-set (solar-adj-time-for-dst date set)))
(adj-set (if set (solar-adj-time-for-dst date set))))
(format "%s, %s at %s"
(if (and rise (calendar-date-equal date (car adj-rise)))
(concat "Sunrise " (apply 'solar-time-string (cdr adj-rise)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment