timeline-lwc icon indicating copy to clipboard operation
timeline-lwc copied to clipboard

Configure dates to display in dd/mm/yyyy format.

Open stefanmelstad23 opened this issue 3 years ago • 5 comments

Is your feature request related to a problem? Please describe. It can be quite confusing for people who are used to using dd/mm/yyyy to look at dates that are mm/dd/yyyy.

Describe the solution you'd like Add a boolean variable to the component configuration on the record page that switches dates to dd/mm/yyyy.

Describe alternatives you've considered Don't know of one yet.

Additional context Add any other context or screenshots about the feature request here.

stefanmelstad23 avatar Aug 18 '22 14:08 stefanmelstad23

Hello @stefanmelstad23 , thank you for submitting an issue we appreciate your time. We will take a look and give you an update as soon as we can. We aim for a 72 hour response time.

github-actions[bot] avatar Aug 18 '22 14:08 github-actions[bot]

Hi @stefanmelstad23 thanks for taking the time to raise an issue. Time Warp has been designed to be globalised. As such the date format should be automatically derived from each users locale setting. Found under Profile -> Language & Time Zone

image

The date and time formats are online here (https://help.salesforce.com/s/articleView?id=sf.admin_supported_date_time_format.htm&type=5)

We double checked and this seems to be working okay. When I select English (Australian) as an example I see the date formats in dd/mm/yyyy format vs English (US) when I see mm/dd/yyyy

Can we get you to tell us which locale you are using?

deejay-hub avatar Aug 19 '22 01:08 deejay-hub

Hi @deejay-hub thank you for the quick response. Yea that was the first thing I checked and my locale has been set to Icelandic (Iceland) the whole time. Still it's displaying mm/dd/yyyy.

image

image

Date fields in Salesforce display dd/mm/yyyy. image

stefanmelstad23 avatar Aug 19 '22 08:08 stefanmelstad23

Thanks @stefanmelstad23. We use the browsers ability to convert dates. Looks like Chromium has an outstanding issue with Icelandic (https://bugs.chromium.org/p/chromium/issues/detail?id=956072&q=icelandic&can=2).

Could you try and open a Firefox browser to confirm it works there for us?

deejay-hub avatar Aug 20 '22 23:08 deejay-hub

new Intl.DateTimeFormat('is-IS', { dateStyle: 'short', timeStyle: 'long' }).format(new Date()) returns the location default for Chrome which is en AU for me and en US for you. 10/09/2022, 21:01:56 GMT+10

But should return 10.9.2022, 20:57:54 GMT+10

Chrome only supports the following locales: https://source.chromium.org/chromium/chromium/src/+/main:third_party/icu/scripts/chrome_ui_languages.list

Given you've taken the time to raise the issue we'll provide a workaround to switch locales in the component if the LOCALE = 'IS' and Browser is Chrome then we'll override the setting to a LOCALE with the same Date Time Format. Finnish.

This will be transparent to the user and provide a function that we can reuse for other locales not in Chrome's support language list in the future.

deejay-hub avatar Sep 10 '22 11:09 deejay-hub

Hi @deejay-hub great to hear that and thank you for the comprehensive responses! Do you have any timeline for this bugfix?

stefanmelstad23 avatar Oct 17 '22 22:10 stefanmelstad23

It's an open source community - with people giving a best efforts time commitment - so dates are subject to change. January 2023 (Release Name - Ross) is the next release we want to make and this is the branch we're using.

deejay-hub avatar Oct 18 '22 01:10 deejay-hub

Completely understand. Just curious about timeline.

stefanmelstad23 avatar Oct 18 '22 13:10 stefanmelstad23