PHP code example of kukla-svitla / yii2-datetime-picker-widget

1. Go to this page and download the library: Download kukla-svitla/yii2-datetime-picker-widget 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/ */

    

kukla-svitla / yii2-datetime-picker-widget example snippets



<?= \svitla\dateTimePicker\Widget::widget([

    // you need specify model and attribute

    'model' => $model,
    'attribute' => 'posted',

    // or name of the input and value (if needed)

    //'value' => '2016/01/22 18:26',
    //'name' => 'specific-name',

    'mode' => \svitla\dateTimePicker\Widget::MODE_DATE,
    // for only date picker
    // or \svitla\dateTimePicker\Widget::MODE_TIME for time picker
    // default is datetime picker

    'language' => 'ru',
    'options' => [ // html options of the input
        'class' => 'my-class',
    ],
    'clientOptions' => [
        'theme' => 'dark',
        'minDate' => '05.12.2013',
        'formatDate' => 'd.m.Y',
    ]
]) 

php composer.phar