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

Add Yii2 date conversion to admin panel #170

Closed
wants to merge 2 commits into from

Conversation

meysampg
Copy link

Description

This merge request add ability of automatic date converting, based on Yii::t function and php-intl extension to module. If this extension is installed in server and user had been selected a language expect en on config.php file, localized date will be shown. Also Farsi translation will add to project with this merge request.

PS. I think '{0, date, MMMM dd, YYYY HH:mm:ss}' => '{0, date, dd MMMM YYYY، HH:mm:ss}', (Based on correct regional format) must be added to all translation files for correct showing of date.

Example

Without this lines

$config = [
    'id' => 'basic',
    // Some code go here
    'sourceLanguage' => 'en-US',
    'language' => 'fa-IR',
    // Some code go here

on web/config.php date is like this:
screen shot 2016-10-20 at 15 15 51
and with them is like this:
screen shot 2016-10-20 at 15 15 24
which is a correct Jalali date.

Signed-off-by: Meysam <p.g.meysam@gmail.com>
@amnah
Copy link
Owner

amnah commented Oct 24, 2016

I added the translation file but left out the {0, date, MMMM dd, YYYY HH:mm:ss}. That part is kinda confusing and is just a template that most people would probably overwrite anyway.

Thanks! b32c7ea

@amnah amnah closed this Oct 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants