So why does this work:
requestInstance.needByDate = new Date() + 4
requestInstance.needByDate.clearTime()
But this doesn’t ?
requestInstance.needByDate= (new Date() + 4).clearTime()
EDIT: as indicated below by Tim this is a bug in Groovy version: 1.7.9-SNAPSHOT (the one I am using of course)
I can’t get it to not work…
Run with Groovy 1.8 prints:
What version of Groovy are you running? Maybe a previous version did not have
clearTimereturning aDate?Edit
Yeah, found it. There was a bug reported that
clearTime()should return aDateand it was fixed in Groovy 1.8.0 and 1.7.11