Hi,
My default language is fa-IR and also my locale is set to fa-IR.
When I try to pick a date the value of the date is wrong. (The DateTime picker shows correct Persian calendar.)
e.g. when I try to pick 5/23/2054 (1402/03/03 in Hejri shamsi) the value of the date field is : Y-۲۵-۲۳ ۱۰:۲۵
What's the problem ?
Thanks
Wrong date value when picking a date by DateTime picker
-
- User
- Posts: 309
Wrong date value when picking a date by DateTime picker
-
- User
- Posts: 9501
mansour wrote:
e.g. when I try to pick 5/23/2054 (1402/03/03 in Hejri shamsi)...
mansour wrote:
I selected 1403/03/03 (hejri shamsi) on the calendat but the value of the field shows as "Y-۲۵-۲۳ ۱۰:۲۵".
- The date/time picker does not support Persian calendar,
- If your locale is "fa-IR", the correct format is "y/M/d", e.g. "2024/5/23", other formats are incorrect and cannot be parsed,
- If your database stores date values like "1402/03/03", the date/time picker will try to show but it will fail. When you select the date it returns a wrong date.
- You need to make sure your dates stored in the database are in the correct format, i.e. "y/M/d", e.g. "2024/5/23".