2017 © Pedro Peláez
 

yii2-extension yii2-date-picker-thai-widget

Bootstrap DatePicker Thai Buddhist-Era (B.E.) widget for Yii2.

image

karatae99/yii2-date-picker-thai-widget

Bootstrap DatePicker Thai Buddhist-Era (B.E.) widget for Yii2.

  • Saturday, June 30, 2018
  • by karatae99
  • Repository
  • 0 Watchers
  • 0 Stars
  • 37 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 68 % Grown

The README.md

Bootstrap DatePicker Thai Buddhist-Era (B.E.) Widget for Yii2

Latest Version License Total Downloads, (*1)

This is thai buddhist calendar datepicker of Yii2 extension., (*2)

modified from (https://github.com/2amigos/yii2-date-picker-widget)., (*3)

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

$ composer require karatae99/yii2-date-picker-thai-widget "~1.0"

or add, (*6)

"karatae99/yii2-date-picker-thai-widget" : "~1.0"

to the require section of your application's composer.json file., (*7)

Usage

DatePicker, (*8)

This widget renders a Bootstrap DatePicker input control. Best suitable for model with date string attribute., (*9)

Example of use with a form
There are two ways of using it, with an ActiveForm instance or as a widget setting up its model and attribute., (*10)



= DatePicker::widget([
    'model' => $model,
    'attribute' => 'date',
    'template' => '{addon}{input}',
    'language' => 'th',          // [
            'autoclose' => true,
            'format' => 'dd/mm/yyyy' //


= $form->field($model, 'date')->widget(
    DatePicker::className(), [
        // inline too, not bad
        'inline' => true, 
        // modify template for custom rendering
        'template' => '
{input}
', 'language' => 'th', // [ 'autoclose' => true, 'format' => 'dd/mm/yyyy' //

Example of use without a model, (*11)

<?php
use karatae99\datepicker\DatePicker;
?>
<?= DatePicker::widget([
    'name' => 'Test',
    'value' => '20/03/2561',
    'template' => '{addon}{input}',
    'language' => 'th',          //<-- Thai B.E.
        'clientOptions' => [
            'autoclose' => true,
            'format' => 'dd/mm/yyyy' //<-- Thai B.E.
        ]
]);?>

DateRangePicker, (*12)

This widget renders a Bootstrap DateRangePicker Input control., (*13)

Example of use with a form
The following example works with a model that has two attributes named date_from and date_to., (*14)

<?php
use karatae99\datepicker\DateRangePicker;
?>
<?= $form->field($model, 'date_from')->widget(DateRangePicker::className(), [
    'attributeTo' => 'date_to', 
    'form' => $form, // best for correct client validation
    'language' => 'th',          //<-- Thai B.E.
    'size' => 'lg',
    'clientOptions' => [
        'autoclose' => true,
        'format' => 'dd/mm/yyyy' //<-- Thai B.E.
    ]
]);?>

Further Information

Please, check the Bootstrap DatePicker site documentation for further information about its configuration options., (*15)

License

The BSD License (BSD). Please see License File for more information., (*16)

The Versions

30/06 2018

dev-master

9999999-dev

Bootstrap DatePicker Thai Buddhist-Era (B.E.) widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Akaranan Naree

extension yii2 calendar yii 2 widget datepicker thai buddhist

30/06 2018

1.0.1

1.0.1.0

Bootstrap DatePicker Thai Buddhist-Era (B.E.) widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Akaranan Naree

extension yii2 calendar yii 2 widget datepicker thai buddhist

20/03 2018

1.0.0

1.0.0.0

Bootstrap DatePicker Thai Buddhist-Era (B.E.) widget for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

by Akaranan Naree

extension yii2 calendar yii 2 widget datepicker thai buddhist