Open SoleSS opened 6 years ago
5 letter languages should work fine. I don't see the reason for this change "$('#{$containerID}').{$picker}($.extend({}, $.datepicker.regional['{$language}'], $options));"
I have the same issue. Here is console output:
jquery-ui-timepicker-uk.js?v=1461180334:4 Uncaught TypeError: Cannot read property 'regional' of undefined
at jquery-ui-timepicker-uk.js?v=1461180334:4
at jquery-ui-timepicker-uk.js?v=1461180334:22
Solution above works for me.
when Yii2 language is set to something else than en-US, widget stops working with error (in browser console): Uncaught TypeError: Cannot read property 'regional' of undefined
solution: move DateTimePickerAsset::register($this->getView()); before if ($language != 'en-US' && $language != 'en') {
and change "$('#{$containerID}').{$picker}($.extend({}, $.{$picker}.regional['{$language}'], $options));" to "$('#{$containerID}').{$picker}($.extend({}, $.datepicker.regional['{$language}'], $options));"
moreover: your widget uses 2 letters language code (en), but on systems with 5 letters (en-US) encoded language - your widget wont get localized... and missing dependency on DatePickerLanguageAsset