PHP code example of years / yii2-datetimepicker

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

    

years / yii2-datetimepicker example snippets


<?= \nkovacs\datetimepicker\DateTimePicker::widget([
    'name' => 'time',
]); 

<?= $form->field($model, 'time')->widget(\nkovacs\datetimepicker\DateTimePicker::className(), [
    'clientOptions' => [
        'extraFormats' => ['YYYY-MM-DD HH:mm'],
    ],
]) 

<?= $form->field($model, 'time')->widget(\nkovacs\datetimepicker\DateTimePicker::className(), [
    'type' => 'date',
]) 

<?= $form->field($model, 'time')->widget(\nkovacs\datetimepicker\DateTimePicker::className(), [
    'type' => 'time',
]) 

\nkovacs\datetimepicker\DateTimeValidator::register();

    ...
    ['timestamp', 'datetime'],
    ['time', 'time'],
    ['date', 'date'],
    ...

php composer.phar