PHP code example of dungphanxuan / yii2-datetimepicker

1. Go to this page and download the library: Download dungphanxuan/yii2-datetimepicker 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/ */

    

dungphanxuan / yii2-datetimepicker example snippets


php composer.phar 

echo TimePicker::widget([
     //'language' => 'fi',
    'model' => $model,
    'attribute' => 'created_at',
    'mode' => 'datetime',
    'clientOptions'=>[
        'dateFormat' => 'yy-mm-dd',
        'timeFormat' => 'HH:mm:ss',
        'showSecond' => true,
    ]
]);

echo TimePicker::widget([
     //'language' => 'fi',
    'name'  => 'from_time',
    'value'  => $value,
    'mode' => 'time',
]);

echo $form->field($model, 'field')->widget(\janisto\timepicker\TimePicker::className(), [
    //'language' => 'fi',
    'mode' => 'datetime',
    'clientOptions'=>[
        'dateFormat' => 'yy-mm-dd',
        'timeFormat' => 'HH:mm:ss',
        'showSecond' => true,
    ]
]);