Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"IntlDateFormatter" function #13

Open
MohammaddReza opened this issue Nov 25, 2015 · 1 comment
Open

"IntlDateFormatter" function #13

MohammaddReza opened this issue Nov 25, 2015 · 1 comment

Comments

@MohammaddReza
Copy link

As you know from php 5.3 and upper,we can use the "IntlDateFormatter" function.
how we can change the whole system calendar by using this following sample code?

$fmt = new IntlDateFormatter("fa_IR@calendar=persian", IntlDateFormatter::FULL,
IntlDateFormatter::FULL, 'Asia/Tehran', IntlDateFormatter::TRADITIONAL);

@anselmdk
Copy link
Member

Good idea.
I actually had similar considerations when writing the importer, as I wanted it to support importing both European and US dates. See 85ec4b8#diff-a53ca3901ccb7247b6f0a27d5adad491R11

Using that format they should be configurable through the config.yml file. We could achieve something similar by allowing for a setting on the calendar config: https://github.com/titledk/silverstripe-calendar/blob/master/code/core/CalendarConfig.php#L30 (which not yet is configurable through yml...)

Then only the methods presenting the strings would have to be amended using IntlDateFormatter for presentation. Under the hood we should stick to the format dates are stored in in MySQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants