Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
alxgh committed Jul 20, 2014
1 parent 8243f66 commit fc0aabc
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ or add
to the require section of your `composer.json` file.


Usage
Usage of "DateTime"
-----

Once the extension is installed, add it as a component :
Expand All @@ -43,4 +43,32 @@ You can access dates and times as variable :

```php
Yii::$app->jdate->Y;
```

Usage of "DatePicker"
-----

It is a widget to make a input, box to giver jalali date from user.

A basic usage:
```php
<?= jDate\DatePicker::widget([
'name' => 'datepicker'
]) ?>
```

If you want set default date set "value":

```php
<?= jDate\DatePicker::widget([
'name' => 'datepicker', 'value' => '1394/01/01'
]) ?>
```

Using a model:

```php
<?= jDate\DatePicker::widget([
'model' => $model, 'attribute' => 'date'
]) ?>
```

0 comments on commit fc0aabc

Please sign in to comment.