mrlco/yii2-jalali-datepicker 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mrlco/yii2-jalali-datepicker

最新稳定版本:2.0.0

Composer 安装命令:

composer require mrlco/yii2-jalali-datepicker

包简介

Jalali (persian) Bootstrap DatePicker Widget for Yii2

README 文档

README

Renders a Persian Web Toolkit's Persian Date Picker (Reza Babakhani's nice work.)

Installation

The preferred way to install this extension is through composer.

Either run

composer require mrlco/yii2-jalali-datepicker:~1.1.0

or add

"mrlco/yii2-jalali-datepicker" : "~1.1.0"

to the require section of your application's composer.json file.

Bootstrap 4 support

From v2.0.0 - Updated to use Bootstrap 4

Usage

DatePicker

This widget renders a Bootstrap Persian DatePicker input control. Best suitable for model with date string attribute.

With a form model

There are two ways:

  • with an ActiveForm instance:
// as a widget
<?= mrlco\datepicker\Datepicker::widget([
    'model' => $model,
    'attribute' => 'date',
    'template' => '{addon}{input}',
        'clientOptions' => [
            'format' => 'YYYY/MM/DD'
        ]
]);?>
  • As a widget, setup its model and attribute
// with an ActiveForm instance 
<?= $form->field($model, 'date')->widget(
    mrlco\datepicker\Datepicker::className(), [
        'inline' => true,
        'template' => '<div class="well well-sm" style="background-color: #fff; width:250px">{input}</div>',
        'clientOptions' => [
            'format' => 'YYYY/MM/DD'
        ]
]);?>

Without any form model

//use without any model
<?= mrlco\datepicker\Datepicker::widget([
    'name' => 'Test',
    'value' => '1394/03/23',
    'template' => '{addon}{input}',
        'clientOptions' => [
            'format' => 'YYYY/MM/DD'
        ]
]);?>

Credits

License

The MIT License.

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-06-12