Limit grafana time range

Is there any way i can limit the selection of time range of dashboards?
in simple words if my limit is 5 hours and someone selects date range of 8 hours then it should give error message that we only support 5 hours of range ?

Welcome @practicepratik

Not sure you can pop a message.

What is the datasource?

Use Loki backend limit

limits_config:
  max_query_length: 5h
or set relative time range if still give error