Issue
-
I have an issue with the Month date format in Objects. I create an Object with a date field. I add a date in English for example, Jul 1, 2024. When I change the locale to Arabic /ar/ using the Saudi locale ar_SA, the Gregorian date format changes to the equivalent one in Arabic which uses the Hijri date format like this: ٢٥ ذو الحجة ١٤٤٥ ه
(25/12/1445) It should display the year and month in Gregorian format but the month is translated to Arabic like this: Jul 1, 2024, in Arabic = the year 2024 month يوليو day 1 - When I create web content with a date field and render it on a page in Arabic, it displays the Gregorian date format correctly in Arabic.
Reproduction Steps:
1. Start DXP 7.4 2023.q4.6
2. Open the Main Menu on the top right and go to Control Panel --> OBJECT --> Objects, add a new Object
3. Click on the new Object, under the "Details" tab go to the SCOPE, find the "Panel Link" drop-down, select "Object", then save.
4. Go to the "Fields" tab and add a Date field (the case is reproduced with the Date and Time field as well), then save it.
5. Go to the "Details" tab and Publish the Object.
6. Go to Control Panel --> OBJECT, find the created object, and add a new Object entry (for example, 07/03/2019), then save it.
7. Go to the created Object Entry to see the Object date details: 07/03/2019 (3rd of July 2019)
8. Add to the URL the Arabic locale /ar and enter.
9. Check the Oject Date information:
Expected Result: The date should display the Gregorian format where the month is just translated to Arabic. So, it should display the year 2019 month يوليو day 3
Actual Result: The date is completely switched to the Arabic Hijri format ٢٧ ذو الحجة ١٤٤٥ هـ (this is the equivalent to the Gregorian format). However, this is inconsistent and can confuse users.
Environment
- Liferay DXP 7.4 Quarterly Release 2023.q4.6
Resolution
- The current behavior is expected. You see the Gregorian format when using structured web content but not when creating an Object with a date field because the format in the Web Content rendered in the Page is being built in Java, not in Javascript as with the Object, that’s why it is different, and that depends on your version of the Java Virtual Machine, meaning, that you could have different results depending on that. The official format for 'ar-SA' is Hijri. However, as a workaround, you can enable another Arabic locale in the portal-ext.properties file and use ar_QA (The Qatari Arabic). The official format for 'ar-QA' is Gregorian, and that cannot be tweaked. If this is not feasible, you may contact our Global Services (GS) for consultation on customizing the current behavior to meet your requirements.
- The Developer Team is working on the feature: LPD-24700 where this issue will be addressed and the date and time pickers will be standardized in DXP. This feature will be developed and released in a future release.