[CAMPMAN-34] Calendar only works, when the user is working in the english locale Created: 05/Apr/22 Updated: 07/Apr/22 Resolved: 07/Apr/22 |
|
| Status: | Closed |
| Project: | Campaign Manager |
| Component/s: | None |
| Affects Version/s: | 3.1.6 |
| Fix Version/s: | 3.1.7 |
| Type: | Bug | Priority: | High |
| Reporter: | Markus Schwarz | Assignee: | Raphael Falvo |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[X]*
Doc/release notes changes? Comment present?
[X]*
Downstream builds green?
[X]*
Solution information and context easily available?
[X]*
Tests
[X]*
FixVersion filled and not yet released
[X] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Date of First Response: |
| Description |
|
If the user has selected a different preferred language as English (for example "German") as a primary language in "Language & Region" (Mac must be restarted after this setting was made). And if the user has selected in its browser (firefox) "User your operating system settings for ..."
And if the user opens then the dx publisher calendar or the campaign manager calendar and steps back in time, the following error should occur:
|
| Comments |
| Comment by Raphael Falvo [ 05/Apr/22 ] |
|
Stack trace : Caused by: java.time.format.DateTimeParseException: Text '01.03.2022' could not be parsed at index 2 |
| Comment by Raphael Falvo [ 06/Apr/22 ] |
|
Hello mschwarz I found and fixed the root cause of the issue, there was a discrepancy between the date formatting done in javascript and what java code was expecting, this happened under certain circumstances. |
| Comment by Markus Schwarz [ 06/Apr/22 ] |
|
Super cool. I'll have a look. |
| Comment by Markus Schwarz [ 06/Apr/22 ] |
|
Works like a charm. Thank you for fixing this. |
| Comment by Raphael Falvo [ 07/Apr/22 ] |
|
Short explanation on the solution applied
connector.refreshEvents(info.view.currentStart.toLocaleDateString("en-GB"), info.view.currentEnd.toLocaleDateString("en-GB")); Passing "en-GB" to toLocaleDateString method ensures that output date is formatted using format : dd/MM/yyyy, which is the format Java is expecting in CalendarComponent.java for parsing. This way there is no risk having discrepancy between JS output format and Java parsing format. Passing the locale in parameters affect only the output formatting. It's a bit confusing, ideally it would have look better if a method accepting the format would exist, but it's unfortunately not the case.
|