pimcore / studio-ui-bundle

Studio UI bundle
Other
14 stars 5 forks source link

[Schedule] Centralized date formatting service #365

Closed markus-moser closed 2 months ago

markus-moser commented 3 months ago

I created a similar issue also for the version view: #356

We should ensure that we have the same date formats everywhere and put the date/time/number formatting to centralized services which are re-used everywhere.

Related to #348

Corepex commented 3 months ago

I already started with that. https://github.com/pimcore/studio-ui-bundle/blob/1.x/assets/js/src/core/app/config/date-time.tsx

There would be the place to configure everything.

BUT: We should question us if its really necessary to have a date / time formatted since this is already handled by i18n. See: https://github.com/pimcore/studio-ui-bundle/blob/1bb82a2cf76c352a9f514e58868b80928a5939cf/assets/js/src/core/components/formatted-date/formatted-date.tsx#L23-L27 or https://github.com/pimcore/studio-ui-bundle/blob/1bb82a2cf76c352a9f514e58868b80928a5939cf/assets/js/src/core/components/formatted-time/formatted-time.tsx#L23-L30

markus-moser commented 3 months ago

@Corepex Please create centralized utils as wrapper of I18N to format dates