# Dashboard time context - realtime data and defining custom date ranges

**URL:** <https://community.cumulocity.com/t/dashboard-time-context-realtime-data-and-defining-custom-date-ranges/7837>\
**Category:** Forum\
**Tags:** cumulocity-edge, cumulocity\
**Created:** [October 28, 2024, 1:41pm UTC](https://community.cumulocity.com/t/dashboard-time-context-realtime-data-and-defining-custom-date-ranges/7837 "2024-10-28T13:41:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrycja.dembinska](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/patrycja.dembinska/32/32538_2.png) [@patrycja.dembinska](https://community.cumulocity.com/u/patrycja.dembinska)\
**Post date:** [October 28, 2024, 1:41pm UTC](https://community.cumulocity.com/t/dashboard-time-context-realtime-data-and-defining-custom-date-ranges/7837/1 "2024-10-28T13:41:24Z")

</div>

#### _ **Product/components** used and **version/fix** level:_

Frontend 1018.0.271  
Backend 1018.0.457

#### _Detailed explanation of the problem:_

I want to implement dashboard time context functionality with realtime data. I also want to have the possibility to add custom ranges that were defined by myself.

 ![Left: The newest released - dashboard time context with realtime data, Right: Available custom date ranges](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/5/4/54b927a8adc8f153a900c78898eb786ec75c672e.png)

Instead of having these options presented above (picture on the right), I want to add my own date ranges. As an example, I have defined a “last 1 hour” date range and I use event subcription functionality (`EventRealtimeService`) to keep my widgets up to date. My implementation gives me the possibility to subscribe to events and updates the “last 1 hour” range, so there is no need to refresh the page to get the current events.

My goal is to have similar functionality, but as dashboard time context to set a custom date range with realtime data for all of the widgets on the dashboard at once.

I’ve found 3 documents about dashboard time context:

- Release 1018:
- Releas 2024:
- The newest release (?) so also 2024? In the url there is no specified release of Cumulocity, but there is an option to set realtime data, which I also want to achieve.

1. Which release contains the functionality to add realtime data option to the dashboard time context?
2. Is there any implemented example of realtime data option in the dashboard time context?
3. How can I define my own custom ranges?
4. Is there a way to pass a parameter with a selected date range instead of passing the `date: [Date, Date]` parameter to the widget? Now when I select an option from the custom range selector - for example “Last minute” - the parameter `date: ["2024-10-28T12:43:44.769Z", "2024-10-28T12:44:44.769Z"]` is passed to the widget. I prefer to pass information to my widget about custom range selection to have an opportunity to subscribe to events and keep my widget up to date with live data.

#### _Question related to a **free trial** , or to a **production (customer)** instance?_

Question is related to production (customer) instance.

---

<div class="post-metadata">

**Author:** ![Tristan\_Bastian](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/tristan_bastian/32/18259_2.png) [@Tristan\_Bastian](https://community.cumulocity.com/u/Tristan_Bastian)\
**Post date:** [October 29, 2024, 9:12am UTC](https://community.cumulocity.com/t/dashboard-time-context-realtime-data-and-defining-custom-date-ranges/7837/2 "2024-10-29T09:12:37Z")

</div>

Hi @patrycja.dembinska,

I’m not sure if I got your idea… What exactly would be the benefit of your “last 1 hour” compared to the default “Last hour” option?

You are probably referring to these documentations:

- CD (continuos delivery) release: [Cumulocity documentation](https://cumulocity.com/docs/)
- 2024 yearly release: [Cumulocity documentation](https://cumulocity.com/docs/2024/)
- 1018 release (already out of maintenance): [https://cumulocity.com/guides/](https://cumulocity.com/guides/)

1. The functionality for realtime on the dashboard time context is covered by [this change log entry](https://cumulocity.com/docs/change-logs/#ui-c8y-10-18-481-0-disable-enable-realtime-for-widgets-on-dashboard-level) which is also part of the [2024 change log](https://cumulocity.com/docs/2024/change-logs/#ui-c8y-10-18-481-0-disable-enable-realtime-for-widgets-on-dashboard-level).

2. Similar to the `globalTimeContext` option, there is a `globalRealtimeContext` option that needs to be enabled on your widget. In addition to that there is also a `globalAggregationContext` option.

3. The dashboard time context was not designed in a way that would allow you to define your own ranges. Which time ranges are missing from your point of view? You might be able to adjust the [`INTERVALS` array](https://resources.cumulocity.com/documentation/websdk/ngx-components/miscellaneous/variables.html#INTERVALS) and the [`INTERVAL_TITLES` object](https://resources.cumulocity.com/documentation/websdk/ngx-components/miscellaneous/variables.html#INTERVAL_TITLES) exposed by the Web SDK to add your own range, but this is nothing we intended and are supporting.

4. I do not get why the custom date range is preventing you from subscribing to realtime data?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [April 27, 2025, 9:13am UTC](https://community.cumulocity.com/t/dashboard-time-context-realtime-data-and-defining-custom-date-ranges/7837/3 "2025-04-27T09:13:25Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
