-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Date discreapncies between Formatter::asDate() and FormatConverter::convertDateIcuToJui() discrepancies #9312
Comments
I am unable to reproduce this, do you have the PHP intl extension installed? |
The discrepancy has changed since I last tested it. intl 1.1.0 In app config
Model and controller <?php
class TestForm extends \yii\base\Model
{
public $date = '2016-11-27';
}
class TestController extends \yii\web\Controller
{
public function actionTest()
{
return $this->render('test', ['model' => new TestForm()]);
}
} View <?php $form = \yii\widgets\ActiveForm::begin(); ?>
<?= $form->field($model, 'date')->widget(\yii\jui\DatePicker::className(), ['dateFormat' => 'medium']) ?>
<?php \yii\widgets\ActiveForm::end(); ?> Initial page load Click on 27 Nov in the date picker Date is now formatted as |
i cannot be sure that intl was installed when i ran the test in aug last year but it most likely was because i have required it as standard for years |
confirm now bower-asset/bootstrap v3.3.7
bower-asset/highcharts v5.0.14
bower-asset/inputmask 3.3.10
bower-asset/jquery 3.2.1
bower-asset/jquery-ui 1.11.4
bower-asset/punycode v1.3.2
bower-asset/typeahead.js v0.11.1
bower-asset/yii2-pjax 2.0.7.1
yiisoft/yii2 dev-master 1ad69de Yii PHP Framework Version 2
yiisoft/yii2-jui dev-master 75e6f78 The Jquery UI extension for the Yii framework php: 7.1.10-fpm-alpine-4yii2-xdebug intl 1.1.0
ICU version => 57.1
ICU Data version => 57.1
<?php
\Yii::$app->language = 'ru';
class TestForm extends \yii\base\Model
{
public $date = '2017-10-25';
}
$model = new TestForm;
$form = \yii\widgets\ActiveForm::begin();
?>
<?= $form->field($model, 'date')->widget(\yii\jui\DatePicker::className(), ['dateFormat' => 'medium']) ?>
<?php \yii\widgets\ActiveForm::end(); ?> |
@bscheshirwork thanks for the detailed research. I just looked into the jquery UI sources and found that they have hardcoded the month names: |
@cebe |
Issue moved to yiisoft/yii2-jui#70 |
yep, thanks for noting. |
I noticed the following differences when using jQuery-UI Datepicker.
Formatter
was providing the date input's initial value on page load and the format changed after using Datepicker.Both are ICU 'medium'.
or something like that
The text was updated successfully, but these errors were encountered: