Skip to content

Instantly share code, notes, and snippets.

@bscheshirwork
Last active May 22, 2020 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bscheshirwork/36a3aec9a4d66106e6cd4a65eaf6c5ab to your computer and use it in GitHub Desktop.
Save bscheshirwork/36a3aec9a4d66106e6cd4a65eaf6c5ab to your computer and use it in GitHub Desktop.
yii2 DI and 2lvl config
->widget(DatePicker::class, [
// 'pluginOptions' => [
// 'autoclose' => true,
// 'format' => 'dd.mm.yyyy',
// 'todayHighlight' => true,
// ],
'removeButton' => false,
]);
'container' => [
'definitions' => [
\kartik\date\DatePicker::class => [
'pluginOptions' => [
'autoclose' => true,
'format' => 'dd.mm.yyyy',
'todayHighlight' => true,
'assumeNearbyYear' => true,
],
'removeButton' => false,
],
\kartik\date\DatePicker::class . '0d' => [
'__class' => \kartik\date\DatePicker::class, //also can use 'class' => \kartik\date\DatePicker::class
'pluginOptions' => [
'autoclose' => true,
'format' => 'dd.mm.yyyy',
'todayHighlight' => true,
'endDate' => '0d',
'assumeNearbyYear' => true,
],
'removeButton' => false,
],
],
],
->widget(DatePicker::class, [
'__class' => \kartik\date\DatePicker::class . '0d', // only '__class' not 'class'
// 'pluginOptions' => [
// 'autoclose' => true,
// 'format' => 'dd.mm.yyyy',
// 'todayHighlight' => true,
// 'endDate' => '0d',
// ],
'removeButton' => false,
]);
@bscheshirwork
Copy link
Author

bscheshirwork commented May 22, 2020

How to use 4 digit of date in \kartik\date\DatePicker

Becouse DI do not correct merge 2st level of config

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