Yii2.0 日期插件yii-jui-datepicker

1.安装插件

composer require yiisoft/yii2-jui

2使用

<?php
use app\models\Date;
use yii\widgets\ActiveForm;
use yii\jui\DatePicker;
 ?>
<table><tr><td>
 <?php 
$model=new Date();
$form = ActiveForm::begin([
'action' => ['campaign/getalltransactions'],
'method'=>'post',
]); ?>
<?=$form->field($model, 'date_start')->
widget (DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd']) ?>
<?php ActiveForm::end(); ?>
</td></tr></table>

 

赞(0)
未经允许不得转载:TaKaSa » Yii2.0 日期插件yii-jui-datepicker