3ch3r46 / bootui-datepicker
The Bootstrap Datepicker extension for yii framework
1.0.0
2014-05-28 06:58 UTC
Requires
This package is auto-updated.
Last update: 2024-12-09 14:13:45 UTC
README
The Bootstrap Datepicker extension for yii framework
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist 3ch3r46/bootui-datepicker "*"
or add
"3ch3r46/bootui-datepicker": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
<?php
use bootui\datepicker\Datepicker;
echo $form->field($model, 'attribute')->widget(Datepicker::className(), [
'format' => 'yyyy-mm-dd',
'addon' => [
'prepend' => [Html::a('btn1', '#', ['class' => 'btn btn-default']), true], // prepend in single button, format [String $content, Boolean $asButton]
'append' => [ // append in multiple button.
[bootui\Button::widget(['label' => 'btn 2']), true],
[bootui\Button::className(), ['label' => 'btn 3'], true], // format [$className, Array $config, Boolean $asButton]
],
],
]);
echo Datepicker::widget([
'model' => $model,
'attribute' => 'date',
'format' => 'yyyy-mm-dd',
]);
echo Datepicker::widget([
'name' => 'date-create',
'value' => '2014-05-26',
'format' => 'yyyy-mm-dd',
]);
?>
Property Datepicker
- boolean
$autoclose
default valuetrue
- boolean
$todayHighlight
default valuetrue
- string
$format
default valueyyyy-mm-dd
- boolean
$multidate
default valuefalse
- string
$multidateSeparator
default value,
- string
$daysOfWeekDisabled
example value0,1
disable the first and second day in week. - boolean
$calendarWeeks
default valuefalse
- boolean
$forceParse
default valuetrue
- boolean|string
$todayBtn
example valuefalse
,true
, or stringlinked
. - string
$language
example valueen
- integer
$weekStart
example value3
start week fromwednesday