Is your feature request related to a problem? Please describe.
I want to use: timeAndDate().past(10, TimeUnit.of(ChronoUnit.YEARS)). However it's not possible to convert this:
java.lang.IllegalArgumentException: No TimeUnit equivalent for Years
The issue is: java.util.concurrent.TimeUnit is inappropriate for date operations, because the largest unit is "days".
Describe the solution you'd like
I propose to not use java.util.concurrent.TimeUnit here at all. Instead use java.time.temporal.TemporalUnit, so that we can use the API like this:
timeAndDate().past(10, ChronoUnit.YEARS)
Describe alternatives you've considered
timeAndDate().past(java.time.Duration duration) might also be a good idea.
Additional context
This proposal also affects other APIs, at least timeAndDate().future()
Is your feature request related to a problem? Please describe.
I want to use:
timeAndDate().past(10, TimeUnit.of(ChronoUnit.YEARS)). However it's not possible to convert this:java.lang.IllegalArgumentException: No TimeUnit equivalent for YearsThe issue is:
java.util.concurrent.TimeUnitis inappropriate for date operations, because the largest unit is "days".Describe the solution you'd like
I propose to not use
java.util.concurrent.TimeUnithere at all. Instead usejava.time.temporal.TemporalUnit, so that we can use the API like this:timeAndDate().past(10, ChronoUnit.YEARS)Describe alternatives you've considered
timeAndDate().past(java.time.Duration duration)might also be a good idea.Additional context
This proposal also affects other APIs, at least
timeAndDate().future()