PHP code example of mrlco / yii2-jalali-datepicker

1. Go to this page and download the library: Download mrlco/yii2-jalali-datepicker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mrlco / yii2-jalali-datepicker example snippets


// as a widget
<?= mrlco\datepicker\Datepicker::widget([
    'model' => $model,
    'attribute' => 'date',
    'template' => '{addon}{input}',
        'clientOptions' => [
            'format' => 'YYYY/MM/DD'
        ]
]);

// 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'
        ]
]);

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