# Advanced date query in Elasticsearch using Kibana

**URL:** <https://discuss.elastic.co/t/advanced-date-query-in-elasticsearch-using-kibana/24764>\
**Category:** Kibana\
**Created:** [July 2, 2015, 5:19am UTC](https://discuss.elastic.co/t/advanced-date-query-in-elasticsearch-using-kibana/24764 "2015-07-02T05:19:31Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [July 2, 2015, 9:44pm UTC](https://discuss.elastic.co/t/advanced-date-query-in-elasticsearch-using-kibana/24764/2 "2015-07-02T21:44:13Z")

</div>

[Kibana scripted fields](https://www.elastic.co/guide/en/kibana/current/managing-fields.html) might be of help here, but the current default scripting language based on [Lucene expressions](http://lucene.apache.org/core/4_9_0/expressions/index.html?org/apache/lucene/expressions/js/package-summary.html) currently does not support date math. You could consider using static Groovy scripts instead, as described [here](https://discuss.elastic.co/t/calling-groovy-script-from-kibana/2542), but it's really convoluted (note that using dynamic Groovy scripts is not secure).

As a result, at this time, I'd recommend simply indexing day-of-week as a separate field in Elasticsearch.

---

_[View the full topic](https://discuss.elastic.co/t/advanced-date-query-in-elasticsearch-using-kibana/24764)._
