Fork me on GitHub
#juxt
<
2022-05-24
>
maleghast07:05:17

Hello Juxt friends 🙂 I have a tick question...

(-> (t/date backfill-start-date)
    (t/>> (t/new-period 1 :months))
    (t/<< (t/new-duration 24 :hours)))
This leads to an error complaining about incompatible types:
Execution error (UnsupportedTemporalTypeException) at java.time.LocalDate/plus (LocalDate.java:1272).
Unsupported unit: Seconds
So... how do I create a date in the past, add a month and then get the day before?

maleghast08:05:45

That's perfect, thanks @U051B9FU1

henryw37408:05:12

welcome. won't be the last time someone asks that question I'm sure 🙂

henryw37408:05:07

I added a 'top tips' bit to the readme bc some of these things come up time and again. maybe should mention this thing there https://github.com/juxt/tick#top-tips

maleghast08:05:45

I reckon it would be a good thing to mention, yeah.

maleghast07:05:05

(in the above example, backfill-start-date is the result of (t/date "2021-01-01") , so the result I am looking for is a date that would be the result of (t/date "2021-01-31") )