I am receiving the deprecation message "getDate is no longer necessary on date fields" on the following:
POST _scripts/test-date
{
  "script": {
    "lang": "painless",
    "source": "doc['starttime'].date.hourOfDay < params.startHour"
  }
}
GET daterangetest/_search
{
  "query": {
    "script": {
      "script": {
        "id": "test-date",
        "params": {
          "startHour": 10
        }
      }
    }
  }
}
However, if I attempt to use any format other than doc['starttime'].date.hourOfDay I receive errors. Is there a better way I should be doing this?
As a follow up: I've been having some difficulty finding examples and documentation of using dates and date_ranges in Painless scripts. Can anyone suggest some reading?