承接 buibr/yii2-datepicker-bs4 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

buibr/yii2-datepicker-bs4

最新稳定版本:v1.2

Composer 安装命令:

composer require buibr/yii2-datepicker-bs4

包简介

Bootstrap 4 date/time picker widget for Yii2

README 文档

README

Credits

Jonathan Peterson (@Eonasdan) for Bootstrap 4 Date/Time Picker.

Antonio Ramirez (@tonydspaniard) for inspiration by Bootstrap DatePicker Widget for Yii2 and code examples.

Installation

The preferred way to install this extension is through composer.

composer require buibr/yii2-datepicker-bs4

Usage

Please refer to the Datepicker documentation web page for options and examples of using Eonasdan's Datepicker widget.

To use widget as date/time picker, set appropriate format, e.g. 'L LT' (as in examples below). See momentjs' docs for valid formats.

With a model

use buibr\datepicker\DatePicker;

print DatePicker::widget([
    'model' => $model,
    'attribute' => 'attrName',
    'language' => 'ru',
    'size' => 'lg',
    'readonly' => true,
    'placeholder' => 'Choose date',
    'clientOptions' => [
        'format' => 'L',
        'minDate' => '2015-08-10',
        'maxDate' => '2015-09-10',
    ],
    'clientEvents' => [
        'dp.show' => new \yii\web\JsExpression("function () { console.log('It works!'); }"),
    ],
])
$config = [
    'addon' => false,
    'size' => 'sm',
    'clientOptions' => [
        'format' => 'L LT',
        'stepping' => 30,
    ],
];

print $form->field($model, 'attrName')->widget(DatePicker::className(), $config);

Without a model

use buibr\datepicker\DatePicker;

print DatePicker::widget([
    'name' => 'datepickerTest',
    'value' => '09/13/2015',
    'clientOptions' => [
        'format' => 'L',
    ],
    'dropdownItems' => [
        ['label' => 'Yesterday', 'url' => '#', 'value' => \Yii::$app->formatter->asDate('-1 day')],
        ['label' => 'Tomorrow', 'url' => '#', 'value' => \Yii::$app->formatter->asDate('+1 day')],
        ['label' => 'Some value', 'url' => '#', 'value' => 'Special value'],
    ],
])

统计信息

  • 总下载量: 9.09k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2019-01-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固