PHP code example of jino5577 / yii2-date-range-picker

1. Go to this page and download the library: Download jino5577/yii2-date-range-picker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jino5577 / yii2-date-range-picker example snippets



use jino5577\daterangepicker\DateRangePicker;

echo DateRangePicker::widget([
    'model'     => $model,
    'attribute' => 'dateRange',
    
    // Optional. Used for calendar localization. 
    // IF `null` (default), default moment.js language will be used.
    'locale'    => 'ru-RU';
    // Daterange plugin options. Default is `null`.
    // See http://www.daterangepicker.com/#options
    'pluginOptions' => [
        /* ... */
        'autoUpdateInput' => false,
    ],
    // Optional. If maskOptions is set, MaskedInput will be used 
    // instead of TextInput. Default is `null`. 
    'maskOptions' => [
        'mask' => '99/99/9999 - 99/99/9999',
    ],
    // Optional. Input control options, 
    // default is `['class' => 'form-control']`.
    'options' => [
        /* ... */
    ],
    // Optional. Widget template, default is `{input}`. 
    // The special tag `{input}` will be replaced with the form input. 
    'template' => '
        <div class="input-group">
            <span class="input-group-addon">
                <span class="glyphicon glyphicon-calendar"></span>
             </span>
            {input}
        </div>
    '
    ],
    // Optional. Javascript callback to be passed to the 
    // plugin constructor. By default, updates the input 
    // and triggers `change` event.
    'callback' => 'function() { /* ... */ }';   
]);

$ php composer.phar