Skip to content

Commit d527e68

Browse files
committed
checkin
1 parent eb492f9 commit d527e68

2 files changed

Lines changed: 7 additions & 16 deletions

File tree

src/witch_clock/calendar.cljs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@
285285
first)
286286
next-season (get NEXT-SEASON season)
287287
next-season-dt (get seasons next-season)
288-
season-i (days-between dawns season-dt dawn)
288+
season-i (inc (days-between dawns season-dt dawn))
289289
season-n (days-between dawns season-dt next-season-dt)
290290
moon-phase-dt
291291
(->> months
@@ -302,8 +302,8 @@
302302
(->> sorted-moon-phase-dt
303303
(filter
304304
(fn [[_month _phase phase-dt]]
305-
(is-before dawn phase-dt)))
306-
last)
305+
(is-before phase-dt dawn)))
306+
first)
307307
[_month _phase month-dt]
308308
(->> sorted-moon-phase-dt
309309
(filter
@@ -317,7 +317,7 @@
317317
(fn [[_month _phase other-phase-dt]]
318318
(is-before phase-dt other-phase-dt)))
319319
last)
320-
phase-i (days-between dawns phase-dt dawn)
320+
phase-i (inc (days-between dawns phase-dt dawn))
321321
phase-n (days-between dawns phase-dt next-phase-dt)
322322
[next-month _next-phase next-month-dt]
323323
(if (not= month next-month*)
@@ -329,7 +329,7 @@
329329
(is-before month-dt next-month-dt)
330330
(not= month next-month))))
331331
last))
332-
month-i (days-between dawns month-dt dawn)
332+
month-i (inc (days-between dawns month-dt dawn))
333333
month-n (days-between dawns month-dt next-month-dt)]
334334
{:cycle [nth-cycle (inc cycle-i) cycle-n]
335335
:season [season season-dt (inc season-i) season-n]

src/witch_clock/templates/calendar.cljs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,24 +194,15 @@
194194
(fn [{:keys [dawn]}]
195195
(calendar/is-before dawn month-start)))
196196
last
197-
:dawn))
198-
month-end (-> months lunar-month last :date)
199-
month-end-day
200-
(when month-end
201-
(->> days
202-
(filter
203-
(fn [{:keys [dawn]}]
204-
(calendar/is-after dawn month-end)))
205-
first
206197
:dawn))]]
207198
[:section>article>details
208199
[:summary>hgroup
209200
[:h3 (str title "'s Moon")]
210-
(if (and month-start month-end)
201+
(if month-start
211202
[:p
212203
[:p
213204
[:span (.toLocaleString month-start-day)]
214-
[:span (str " ; ends at " (.toLocaleString month-end-day))]]]
205+
[:span (str " ; New Moon occurs at " (.toLocaleString month-start))]]]
215206
[:p "Does not occur this year."])]
216207
(when html
217208
(alchemy/profane :p html))])])

0 commit comments

Comments
 (0)