PHP code example of brussens / yii2-datetimepicker-widget
1. Go to this page and download the library: Download brussens/yii2-datetimepicker-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/ */
brussens / yii2-datetimepicker-widget example snippets
use brussens\datetimepicker\Widget as DateTimePicker;
echo $form->field($model, 'attribute')->widget(DateTimePicker::className());
use brussens\datetimepicker\Widget as DateTimePicker;
echo $form->field($model, 'attribute')->widget(DateTimePicker::className(), [
'format'=>'DD-MM-YYYY HH:mm:ss',
'clientOptions' => [
'locale' => 'ru', //If you do not want to use auto-detection
'icons' => [
'time' => 'el-icon-time',
'date' => 'el-icon-calendar',
'up' => 'el-icon-chevron-up',
'down' => 'el-icon-chevron-down',
],
'useSeconds' => true,
'useCurrent' => true,
'sideBySide' => true
],
]);