Date_calc
I wrote datecalc …
> irb
> require './datecalc'
irb(main):002> dc = DateCalc.new('2026-05-25')
irb(main):003> dc.w + 5 # advance 5 weeks
irb(main):005> puts dc # '2026-06-29'
And datecalc knows about Spring Equinox.. and Fall Equinox. It knows about Easter and Full Moon… and about the Soltices.
→MS # advance to next Summer Soltice (or stay if condition is met)
→SE→FM→Thu # advance to next Summer Equinox,
# then to next Full Moon, then to next Thursday
dc = DateCalc.new # 2026-05-27
dc.m + 5 # => #<DateCalc …> (date advanced 5 months)
puts dc # 2026-10-27
puts dc.m # 10 (read the new value via to_s)
dc.d - 10 # => #<DateCalc …> (back 10 days)
puts dc # 2026-10-17
dc.y + 1 # => #<DateCalc …>
puts dc # 2027-10-17
# chaining works
(dc.y + 1).m + 2 # advance year by 1, then months by 2
Find real midsummer:
→MS←Fri # advance to Summer soltice, back to previous Friday
I have not yet mentioned .odd?, .even?, % (dividable by)