Quantcast
Channel: Live News for Yii Framework
Viewing all articles
Browse latest Browse all 3361

[extension] pcrt/yii2-datepicker

$
0
0

Yii2-Datepicker

  1. Installation
  2. Usage
  3. License

Daterangepicker gives you a customizable daterangepicker with support for multidate, time, localization and many other highly used options.

Installation

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require pcrt/yii2-datepicker "*"

or add

"pcrt/yii2-datepicker": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, modify your application configuration to include:

use pcrt\widgets\datepicker\Datepicker:


// with \yii\bootstrap\ActiveForm;
echo $form
    ->field($model, 'attribute')
    ->widget(
        Datepicker::class,
        [
          'clientOptions' => [
            'singleDatePicker' => true,
            'showDropdowns' => true,
          ]
        ]
    );

// as widget
echo Datepicker::widget([
    'clientOptions' => [
      'showDropdowns' => true,
    ]
]);

License

Yii2-Datepicker is released under the BSD-3 License. See the bundled LICENSE.md for details.

Enjoy!


Viewing all articles
Browse latest Browse all 3361

Trending Articles