Configure Grafana to show weekdays

Hi everybody,

I’m using the newest versions of HA and the Grafana addon and I would like to display weekdays instead of the date to label the x axis. While searching I’ve found the following link:

https://grafana.com/blog/2020/09/23/grafana-v7.2-released-with-custom-date-formats-new-transforms-and-overrides/#new=date-formatting-options-added

Unfortunately, I cannot find the config file to add the lines described above.

Did someone manage to show weeksdays in a graph like this or can someone please point to into the right direction?

Thanks a lot,
Fridolin

On the Grafana addon page click on the Configuration tab and enter the environment variables you want:

Hi @tom_l ,

thanks a lot. I was pretty happy about your answer and thought, that would absolutely solve my question.
But until now, I can change the format (values) to what I want, but it has no effect on the graphs afterwards. Nothing helps, not restarting the addon, nor restarting HA completely.
It seems, I still miss something.

Thanks,
Fridolin

Show what you tried.

First I’ve added the following lines:
image

I learned that those variables need to start with GF…, because otherwise a validation is complaining - at least this is what I’m currently thinking. I’ve tried to search for some kind of manual pages to tell me, how the naming convention is, but failed.
Either way, just using the names from the Grafana help pages (like full_date or interval_month) does not work, so I guess I need the extended form with a leading GF_DATE_FORMAT_

After restarting the addon, I can see in the log that something is done:

And now I was expecting that when I check a dashboard and change the displayed time interval, the format would have been changed accordingly. I tried a lot of different variations of those values, but I didn’t see any effect, nor have I been able to find a pattern to work with.

Last 24h:

Last 30 days:

Last 6 months:

I’m only seeing default values…

Thanks in advance,
Fridolin

The name begins with GF_ DATE_FORMATS_ not GF_DATE_FORMAT_

Screenshot 2021-12-12 at 22-22-15 Configuration

https://grafana.com/docs/grafana/v7.5/administration/configuration/#date_formats

1 Like

Thank you!

I don’t know, whether I should be sad or happy, but I’ll be able to sort that out…

If you just write INTERVAL_MONTH, the application is complaining like: image

But if you miss an ‘S’, it is quiet and I wasted hours, because I didn’t see this.

Fine - problem solved.

Now I just need to figure out, whether names of weekdays are supported or not and then I’m totally happy. As you can see on the screenshot, I tried Ds and Es, but still no success. :wink:

Thanks,
Fridolin

1 Like

List of available tokens: https://momentjs.com/docs/#/displaying/

Looks like you want ddd

1 Like

Works like a charm - this link is now bookmarked. Thanks again :+1: :+1: :+1:

1 Like