I tested it in my Kibana , although my test fields were numbers - but I'm sure it will work with dates.
One thing to note though is that you'll need to have groovy scripting enabled on your elasticsearch for it to work.
I dont think it Is by default - sorry, for got about that.
Just edit your
/etc/elasticsearch/elasticsearch.yml file and
script.disable_dynamic: true to the bottom. Or change from false to true if it already exists.
Of course enabling dynamic scripting does have some security (amongst other) implications... so consider this scripting page.