97jaz / gregor

Date and time library for Racket
45 stars 10 forks source link

how to find the quarter containing a `datetime`? #55

Closed mbutterick closed 1 year ago

mbutterick commented 1 year ago

I want to test whether a datetime falls within a certain quarter of the year, so I want to inspect its month. But datetime-month does not exist. What is the best method?

97jaz commented 1 year ago

@mbutterick datetime implements the gen:date-provider generic interface, so you can call ->quarter on it. See: https://docs.racket-lang.org/gregor/date-provider.html#%28def._%28%28lib._gregor%2Fmain..rkt%29._-~3equarter%29%29