Hi
Thank you for you feedback.
Unfortunately Zend_Date desn't support Jalali (Persian) Calendar. It just provide localization (Translation for months name). As you mentioned, I always switch locale but it doesn't help as Zend doesn't support a different calendar.
I've managed to change whole calendar by using
https://github.com/sallar/jDateTime (PHP Jalali Date Library). Now every "date object" in CMS or Framework is JDate. I Also altered Javascript calendar UI to support Jalali date. Everything seems to work fine (Filtering and other date and time related functionalities)
I've Altered these files:
framework/model/fieldtypes/Date.php
framework/model/fieldtypes/Datetime.php
framework/forms/DateField.php
framework/forms/DatetimeField.php
framework/thirdparty/jquery-ui/datepicker/i18n/jquery.ui.datepicker-fa.js
In Field classes I altered:
setValue, Format, Format, FormatI18N, FormatFromSettings, Rfc822, Rfc2822, Rfc3339, Age, TimeDiff, TimeDiffIn and almost every instance of date() or zend_date.
The PHP function I used has same interface as PHP's builtin date().
Switching jQuery UI datepicker and calendar should work fine, but what is a good solution here? I would like to contribute to Silverstripe and make it compatible with my locale calendar.
By altering those classes date values stored in database are Jalali date!
What is a good solution (design) to this multi calendar problem?
Is it good to store time and date values in a universal format (i.e Unix time) and convert in on retrieval based on locale?
Where else do you think I should alter to have complete JDate support?
Thanks
Mazdak