I have a search query for Elasticsearch which uses a groovy inline script that I need to convert to Painless language
mdt= doc.eventstartdate.value;
dtevent = new DateTime(mdt).withTime(0,0,0,0).getMillis();
d = (dtevent<dtnow?dtnow:dtevent);
As you can see, this grabs the 'eventstartdate', strips the time off (sets to 00:00:00)
Then it compares with current date (dtnow) and if less than current date, changes it to the current date (effectively there are no past dates, just today onwards)
I'm not a Java programmer and I believe the date processing has changed in Painless so looking to convert the above?
Thanks