Hello, is there a way to adjust the date format of...
# gooddata-ui
b
Hello, is there a way to adjust the date format of the embed dashboards? It seems that setting the locale of the dashboard isn't enough, see the screen where the locale is currently fr-FR and filters are correctly translated but the dates are in US format (both in the filters and the visualizations)
image.png
t
Hi, @Bastien Dewerse, which version of GoodData are you using? Is it GoodData Platform or GoodData Cloud?
b
GD Cloud & UI SDK v9.1.0
t
Please check the article Change Date Format. In general date format can be set on: • Organization level • Workspace level • User level
b
Thanks for answering but I already checked it sadly. What I'm trying to do is being able for a web app (with its own locale) to set the date format of the embed dashboard at display time (meaning it should be able to display different formats for a given org, given workspace and given user). For the locale it's currently doable via the "locale" field of DashboardConfig when rendering the Dashboard component, but it seems there's no config for the date format.
t
Thanks for the explanation. I will let someone with more in depth knowledge to step in. I’m unfortunately not aware of this being possible.
👍 1
b
Hello, any news on this or is it actually completely impossible?
s
Hello! sorry to up once again this issue 😕 I had a quick look at the underlying code and it seems Gooddata is using the date-fns library to format the date according to a locale. We are passing the correct locale to the dashboard component (hence we have the "chrome" of the dashboard translated) but every dates are still in the wrong format. Can you confirm that it is not possible to change the dateformat with the Dashboard component, only by writing it the workspace (thus hardcoding it for all users)?
p
IMHO date format is affected by format locale settings prop only, not by locale on dashboard.
However, you can set this property not only on organization and workspace level but on user level as well, i.e., each user can have different date format locale set. You need to do it via API. It’s described in the mentioned documentation: https://www.gooddata.com/docs/cloud/customize-appearance/change-date-format/
1
s
thanks you for the answer, we'll see if we can make use of that! cheers
p
happy to help