Open MohammadSafaeii opened 1 year ago
https://user-images.githubusercontent.com/38601142/204464567-c537f0dd-a0e7-41ab-88d3-9ae4ea8e6e3d.mp4 This problem exists in Persian language, The problem is solved by replacing the datepicker with a version that supports the Persian language. But the date display is not modified by jalali moment.
You can share module?
You can share module?
Not yet completed on the other hand, oca does not accept the calendar module and odoo due to Iran embargo It is not possible to add this item
It is enough to solve the problem from right to left
The root issue is about moment local support.
Moment uses a post process and replaces all digits with a local one. On the other hand, the moment is used by the date picker (tempusdominus).
So, the date picker converts the date into the local format and sets it into the input field.
The date field gets the string and tries to use Luxon and convert it into a date object.
Finally, Luxon fails and returns a null object.
Luxon supports an option named numberingSystem. So if the DateField sends this option based on the current local, everything goes well.
I`ve checked this solution locally.
https://github.com/odoo/odoo/blob/16.0/addons/web/static/lib/luxon/luxon.js#L6834
parseFromTokens(localeToUse, text, fmt) text = "۲۰۲۳/۰۲/۰۵"
If datepicker does not return the date with Persian numbers, the problem will be solved
https://github.com/odoo/odoo/blob/16.0/addons/web/static/lib/luxon/luxon.js#L6834
parseFromTokens(localeToUse, text, fmt) text = "۲۰۲۳/۰۲/۰۵"
If datepicker does not return the date with Persian numbers, the problem will be solved
the datepicker (tempusdominus) is designed base moments. I`ve made a patch to solve this issue. I'll submit it as a pull request soon.
datepicker
in Persian won't work (nothing changes after selecting the date),daterangepicker
won't work in both languages (Arabic and Persian) Persian and Arabic use different numbers I think you should convert them first and then use them. It is handled indatepicker
for Arabic, but in Persian, it won't workdaterangepicker
has errors in both languagesdaterangepicker
error: