4

I'm facing DateTime format issue on the SPEAK DateTime Picker. Basically, when the user is in the Content Editor, the format displays ok (mm/dd/yyyy).

But when the user opens the Experience Editor, clicks on the field, and clicks on the calendar icon, and it will show a pop-up. This pop-up (Select Date) is showing the wrong date-time format(dd/mm/yyyy).

The only solution that I found so far was editing the associated JavaScript file (\sitecore\shell\client\Business Component Library\Layouts\Renderings\Common\DatePickers\DateTimePickers.js).

Does anyone has a more elegant solution for this issue? I already tried things like DefaultRegionalIsoCode but it seems it does not affect the SPEAK Component, so far just this change on .js worked

Thanks

2 Answers 2

3

I'm glad that Sitecore is now aware of the bug and it will provide a official fix

I made a blog about this a couple months ago with the detailed Discussion and the research of the issue

https://errorcotidianam.wordpress.com/2018/04/30/sitecore-9-1-datepicker-displaying-wrong-format/

I will also update my blog post with this version provided from Sitecore

Thanks for letting me know that .

2

According to the help desk, yes you still have to edit the file.

\sitecore\shell\client\Business Component Library\Layouts\Renderings\Common\DatePickers\DatePicker.js

But instead of fixing the hard-coded date format to your desired format, update this line:

this.model.set("dateFormat", "mm/dd/yyyy");

To this:

this.model.set("dateFormat", this.$el.attr("data-dateformat"));

I'm not sure yet if Sitecore considers this a bug and if it will be fixed in future versions (it is there in 90u1 and u2). As soon as they answer this question I will let you know.

1
  • Sitecore responded: "The bug was not yet fixed in a public release, and there is no specific ETA or version number, unfortunately. When the bug is fixed, it's reference number will be added to the appropriate release notes." Oct 11, 2018 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.