aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1993-06-22 03:24:44 +0000
committerJim Blandy1993-06-22 03:24:44 +0000
commit80e48f9fa82af050b969994eb86cd314b656cc33 (patch)
treeb4524a1a679d600231dc51fbcf02352256704de6
parent8ec105a066d2d0b8d7ac02bdecbe95b43dcf53d4 (diff)
downloademacs-80e48f9fa82af050b969994eb86cd314b656cc33.tar.gz
emacs-80e48f9fa82af050b969994eb86cd314b656cc33.zip
* lunar.el (lunar-phase): Use time conversion from solar.el
-rw-r--r--lisp/calendar/lunar.el40
1 files changed, 6 insertions, 34 deletions
diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el
index d6ef380e44c..7929efeb3d1 100644
--- a/lisp/calendar/lunar.el
+++ b/lisp/calendar/lunar.el
@@ -160,41 +160,13 @@ remainder mod 4 gives the phase: 0 new moon, 1 first quarter, 2 full moon,
160 ((= phase 2) (- adjustment adj)) 160 ((= phase 2) (- adjustment adj))
161 (t adjustment))) 161 (t adjustment)))
162 (date (+ date adjustment)) 162 (date (+ date adjustment))
163 (calendar-standard-time-zone-name 163 (date (+ date (- (/ (solar-ephemeris-correction
164 (if calendar-time-zone calendar-standard-time-zone-name "UT")) 164 (extract-calendar-year
165 (calendar-daylight-savings-starts 165 (calendar-gregorian-from-absolute
166 (if calendar-time-zone calendar-daylight-savings-starts)) 166 (truncate date)))) 60.0 24.0))))
167 (calendar-daylight-savings-ends
168 (if calendar-time-zone calendar-daylight-savings-ends))
169 (calendar-time-zone (if calendar-time-zone calendar-time-zone 0))
170 (year (extract-calendar-year
171 (calendar-gregorian-from-absolute (truncate date))))
172 (dst (and calendar-daylight-savings-starts
173 calendar-daylight-savings-ends
174 (<= (calendar-absolute-from-gregorian
175 (eval calendar-daylight-savings-starts))
176 date)
177 (< date
178 (calendar-absolute-from-gregorian
179 (eval calendar-daylight-savings-ends)))))
180 (date (+ date
181 (/ (+ (if dst 60 0) calendar-time-zone) 60.0 24.0)
182 (- (/ (solar-ephemeris-correction year) 60.0 24.0))))
183 (time (* 24 (- date (truncate date)))) 167 (time (* 24 (- date (truncate date))))
184 (date (calendar-gregorian-from-absolute (truncate date))) 168 (date (calendar-gregorian-from-absolute (truncate date))))
185 (time-zone calendar-time-zone) 169 (list date (solar-time-string time date) phase)))
186 (time-zone (if dst
187 calendar-daylight-time-zone-name
188 calendar-standard-time-zone-name))
189 (24-hours (truncate time))
190 (12-hours (format "%d" (if (> 24-hours 12)
191 (- 24-hours 12)
192 (if (= 24-hours 0) 12 24-hours))))
193 (am-pm (if (>= 24-hours 12) "pm" "am"))
194 (minutes (format "%02d" (round (* 60 (- time 24-hours)))))
195 (24-hours (format "%02d" 24-hours))
196 (time (mapconcat 'eval calendar-time-display-form "")))
197 (list date time phase)))
198 170
199(defun lunar-phase-name (phase) 171(defun lunar-phase-name (phase)
200 "Name of lunar PHASE. 172 "Name of lunar PHASE.