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

Fix for bug with PHP date format when convertFormat=true and widget format is not set #42

Closed
wants to merge 1 commit into from

Conversation

PowerGamer1
Copy link

Problem: when DatePicker is configured with convertFormat=true, format not specified and Yii::$app->formatter specified the date in PHP format (for ex. 'php:Y-m-d'), the DatePicker incorrectly calls convertDateIcuToPhp() on that PHP format.

This happens due to the condition if (isset($this->dateFormat) ... ) being always false, because the $dateFormat field does not exist (and never set) in both InputWidget and DatePicker classes. The local variable $format should have been used in the if instead.

… not set

Problem: when `DatePicker` is configured with `convertFormat=true`, `format` not specified and `Yii::$app->formatter` specified the date in PHP format (for ex. 'php:Y-m-d'), the DatePicker incorrectly calls convertDateIcuToPhp() on that PHP format.

This happens due to the condition `if (isset($this->dateFormat) ... )` being always false, because the `$dateFormat` field does not exist (and never set) in both `InputWidget` and `DatePicker` classes. The local variable `$format` should have been used in the `if` instead.
@kartik-v
Copy link
Owner

Will review and update on this.

@kartik-v kartik-v added the bug label Oct 22, 2015
@kartik-v
Copy link
Owner

Resolved via latest release update v1.7.8.

@kartik-v kartik-v closed this Oct 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants