I'm trying to write an app that needs to do some date arithmetic. However, I'm running into this warning:
Importing [java.time.temporal.TemporalAdjusters] is not allowed
I found @gopher.ny's post listing the allowed imports, and indeed, it's not there. Is there a reason those functions are prohibited or is this more a matter of "don't open unless someone needs them"?
The function I'm trying to access is dayOfWeekInMonth()
, so that I can handle holidays which occur e.g. the fourth Thursday of November. It's possible to grab an instance of the first of the month, skip forward to the desired day of the week, then skip forward the necessary number of weeks, but there's a perfectly good function to do that for me in Java/Groovy, so....