PHP code example of alexantr / yii2-datetimepicker

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

    

alexantr / yii2-datetimepicker example snippets


<?= alexantr\datetimepicker\DateTimePicker::widget(['name' => 'attributeName']) 

<?= $form->field($model, 'attributeName')->widget(alexantr\datetimepicker\DateTimePicker::className()) 

<?= alexantr\datetimepicker\DateTimePicker::widget([
    'name' => 'attributeName',
    'clientOptions' => [
        'allowInput' => false,
        'enableTime' => false,
        'enableSeconds' => false,
        'dateFormat' => 'Y-m-d',
    ],
]) 

[
    'allowInput' => true,
    'dateFormat' => 'Y-m-d H:i:S',
    'enableTime' => true,
    'enableSeconds' => true,
    'minuteIncrement' => 1,
    'time_24hr' => true,
]