Implementing Other Culture's Calendar in Grafana

I am currently using Grafana for my data visualization needs and have been greatly satisfied with its capabilities. However, I have a requirement to display data based on different cultural calendars and time formats. I wanted to inquire if there is a way to implement or integrate other culture’s calendar and time formats into Grafana.

Specifically, I am interested in:

  1. Displaying dates based on [specific cultural calendar, e.g., “Hijri Calendar for Islamic dates”].

If this feature is not currently available, could you guide me on any plugins or workarounds that might help achieve this? Additionally, if there are any plans to introduce such a feature in future releases, I would appreciate any insights on that.

Thank you for your assistance and looking forward to your response.

Best regards,

Hi @charimawork, as you’ve pointed out, Grafana currently does not support calendars other than the Gregorian calendar. Additionally, the UI components that display dates and time within Grafana are not consistent in how they represent the final date, as they all convert it to the Gregorian calendar using various libraries.

To my knowledge, there are no plans to add support for a different calendar in Grafana, and there are currently no plugins available that can modify Grafana to use a different calendar.

Furthermore, creating a plugin to modify the way Grafana displays calendars, even just visually, presents several difficulties:

  • Not all elements rendered in Grafana are coded by GrafanaLabs or are part of the Grafana sourcecode. Third-party plugins, such as panels, often use their own calendar and date libraries that assume the use of the Gregorian calendar.

  • As plugins cannot be modified by other plugins, there will be many instances where you will still see dates displayed according to the Gregorian calendar, even if you somehow modify Grafana to use a different calendar, such as the Hijri calendar.

  • The current Grafana plugin’s API does not allow for the modification of how the grafana/ui components render. This means that you cannot overwrite the DatePicker component, for example, and change its rendering to display a different calendar. You’ll have to do this in a sort of post-processing that can be heavily performance impactful.

  • Quite often datasources return time labels pre-formatted that are directly rendered on panels you see in dashboards.

  • Handling relative times would be particularly challenging. The values associated with concepts like “week,” “month,” and “year” used in relative times are mostly hardcoded to the values of the Gregorian calendar. Even if you manage to change the display to a different calendar, the relative times would still use the Gregorian calendar values for options like “a year ago” or “last month.”

Because of all the mentioned reasons, supporting alternate calendars in Grafana remains a complex and somewhat impossible task unless a big part of the core and plugins are changed or one is willing to constantly see hybrid dates and probably incorrect date-timed data.