# Dynamically change time range depending on variable

**URL:** <https://community.grafana.com/t/dynamically-change-time-range-depending-on-variable/10552>\
**Category:** Configuration\
**Created:** [September 18, 2018, 1:27pm UTC](https://community.grafana.com/t/dynamically-change-time-range-depending-on-variable/10552 "2018-09-18T13:27:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vadimp](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/vadimp/32/4500_2.png) [@vadimp](https://community.grafana.com/u/vadimp)\
**Post date:** [September 18, 2018, 1:27pm UTC](https://community.grafana.com/t/dynamically-change-time-range-depending-on-variable/10552/1 "2018-09-18T13:27:02Z")

</div>

Is it possible to have a single-choice variable in Grafana change the time range the user is seeing? I’m happy to script something if that’s needed.

---

<div class="post-metadata">

**Author:** ![vadimp](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/vadimp/32/4500_2.png) [@vadimp](https://community.grafana.com/u/vadimp)\
**Post date:** [April 23, 2019, 1:23pm UTC](https://community.grafana.com/t/dynamically-change-time-range-depending-on-variable/10552/2 "2019-04-23T13:23:01Z")

</div>

Bump - would anyone know? Is it possible to script this with custom JS?

---

<div class="post-metadata">

**Author:** ![rwalker](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/rwalker/32/28411_2.png) [@rwalker](https://community.grafana.com/u/rwalker)\
**Post date:** [December 12, 2022, 8:18am UTC](https://community.grafana.com/t/dynamically-change-time-range-depending-on-variable/10552/3 "2022-12-12T08:18:09Z")

</div>

> [@vadimp](#):
>
> single-choice variable

Could you explain what you mean by “single-choice variable”?
