2017 © Pedro Peláez
 

yii2-extension yii2-daterangepicker

Bootstrap Date Range Picker widget for Yii 2 Framework

image

fatjiong/yii2-daterangepicker

Bootstrap Date Range Picker widget for Yii 2 Framework

  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 50 % Grown

The README.md

About

Bootstrap Date Range Picker widget for Yii 2 Framework, (*1)

It is actually a Yii 2 wrapper for famous https://github.com/dangrossman/bootstrap-daterangepicker extension., (*2)

This widget uses 3.0 Bootstrap CSS since Bootstrap 3.0 is included to Yii 2 as extension., (*3)

To learn more details about options JS please visit read ://github.com/dangrossman/bootstrap-daterangepicker documentation., (*4)

Usage Example

// Include namespace
use fatjiong\daterangepicker\DateRangePicker as DateRangePicker;

// Define  ranges correctly
$ranges = new \yii\web\JsExpression("{
                    'Today'        : [Date.today(), Date.today()],
                    'Yesterday'    : [Date.today().add({ days: -1 }), Date.today().add({ days: -1 })],
                    'Last 7 Days'  : [Date.today().add({ days: -6 }), Date.today()],
                    'Last 30 Days' : [Date.today().add({ days: -29 }), Date.today()],
                    'This Month'   : [Date.today().moveToFirstDayOfMonth(), Date.today().moveToLastDayOfMonth()],
                    'This Year'    : [Date.today().moveToMonth(0,-1).moveToFirstDayOfMonth(), Date.today()],
                    'Last Month'   : [Date.today().moveToFirstDayOfMonth().add({ months: -1 }), Date.today().moveToFirstDayOfMonth().add({ days: -1 })]
                }");

// Define empty callback fust for fun
$callback = new \yii\web\JsExpression("function(){}");

// Provide required parameters and render the widget
  echo DateRangePicker::widget([
        'callback' => $callback,
        'options'  => [
           'ranges' => $ranges,
           'locale' => [
            'firstDay' => 1
           ]
        ],
        'htmlOptions' => [
        'name'        => 'daterange',
        'class'       => 'form-control',
        'placeholder' => 'Select Date Range',
        'style'       => 'width:190px;',
        ]
    ]);

The Versions

24/06 2018

dev-master

9999999-dev

Bootstrap Date Range Picker widget for Yii 2 Framework

  Sources   Download

Apache-2.0 GNU GENERAL PUBLIC LICENSE

The Requires

 

jquery bootstrap yii daterangepicker

24/06 2018

v0.0.1

0.0.1.0

Bootstrap Date Range Picker widget for Yii 2 Framework

  Sources   Download

GNU GENERAL PUBLIC LICENSE

The Requires

 

jquery bootstrap yii daterangepicker