juxt

maleghast 2022-05-24T07:45:17.996399Z

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?

2022-05-24T08:13:32.399689Z

use a period rather than duration. see https://docs.oracle.com/javase/tutorial/datetime/iso/period.html

maleghast 2022-05-24T08:15:45.023109Z

That's perfect, thanks @henryw374

maleghast 2022-05-24T08:15:52.404109Z

facepalm

maleghast 2022-05-24T08:15:56.796279Z

facepalm

2022-05-24T08:18:12.869909Z

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

2022-05-24T08:19:07.331269Z

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

maleghast 2022-05-24T08:23:28.748829Z

nods

maleghast 2022-05-24T08:23:45.708879Z

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

maleghast 2022-05-24T07:47:05.512099Z

(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") )