Set default date formatting on global or app level

When using dates and times in tables and other components that default formatting for dates is "MMM d, yyyy" and times are shown in 12-hour format and without seconds. Also, by default dates/times are shown in the local time zone of the user.

If we wanted to show dates/times in a different format, e.g. with seconds and 24-hour format and dd/MM/yyyy for dates, and in UTC time zone, we do need to update this for every component (or even column in a table that is showing dates/times).

It would be much more efficient if we could set a default on app-level if not even on global level?

2 Likes

Hey @moritz, welcome to the community :hugs:

Agree! App/Global level settings for localization would be awesome.

I ran into the same issue and just created a transformer that holds all of my localization pref. and reference that in my components.

1 Like

Seconding that this would be a really great (and simple to add?) feature.

@moritz,

For a workaround you could use a technique similar to this: [how-to] Use a global lookup array on all of your apps in your organization's javascript settings.

Store your global momentjs formats like:

window.dataFormat = ""MMM d, yyyy""

Then you could this in all of your data output: moment(myDate.value).format(dataFormat)

A similar technique (maybe on an app level instead) would also get your time zones.

1 Like