bupy7 / yii2-date-range-picker
此包已被放弃且不再维护。未建议替代包。
用于 Yii2 的 Bootstrap 日期范围选择器包装器。
v1.0.1
2015-12-12 12:53 UTC
Requires
- bower-asset/bootstrap-daterangepicker: ~2.1
- yiisoft/yii2: *
- yiisoft/yii2-bootstrap: *
This package is not auto-updated.
Last update: 2020-01-24 16:03:21 UTC
README
用于 Yii2 的 Bootstrap 日期范围选择器包装器。
有关插件的更多信息: https://github.com/dangrossman/bootstrap-daterangepicker
安装
通过 composer 安装此扩展是首选方式。
运行以下命令之一:
php composer.phar require --prefer-dist bupy7/yii2-date-range "*"
或添加以下内容到您的 composer.json
文件的 require 部分:
"bupy7/yii2-date-range": "*"
to the require section of your composer.json
file.
使用方法
作为表单字段
echo $form->field($model, 'date_range')->widget(DateRangePicker::className(), [ 'pluginOptions' => [ // see http://www.daterangepicker.com/#options ], 'pluginEvents' => [ // see http://www.daterangepicker.com/#events ], // Language of plugin. If `null` then `\yii\base\Application::language` will be used. 'language' => 'ru', // Converting date format from PHP DateTime to Moment.js DateTime. 'convertDateFormat' => true, // Options of field input. 'options' => [ ], ]);
作为独立的控件
DateRangePicker::widget([ 'name' => 'date_time', 'pluginOptions' => [ // see http://www.daterangepicker.com/#options ], 'pluginEvents' => [ // see http://www.daterangepicker.com/#events ], // Language of plugin. If `null` then `\yii\base\Application::language` will be used. 'language' => 'ru', // Converting date format from PHP DateTime to Moment.js DateTime. 'convertDateFormat' => true, // Options of field input. 'options' => [ ], ]);
##许可证
yii2-date-range-picker 采用 BSD 3-Clause 许可证发布。