PHPackages                             mohammad-mahdy/yii2-jdate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mohammad-mahdy/yii2-jdate

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mohammad-mahdy/yii2-jdate
=========================

Jalali date &amp; time.

0.8.1(9y ago)148.5k13[3 issues](https://github.com/mrmoon/yii2-jdate/issues)5BSD-3-ClauseJavaScript

Since May 24Pushed 5y ago4 watchersCompare

[ Source](https://github.com/mrmoon/yii2-jdate)[ Packagist](https://packagist.org/packages/mohammad-mahdy/yii2-jdate)[ RSS](/packages/mohammad-mahdy-yii2-jdate/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (6)Dependencies (1)Versions (7)Used By (5)

Jalali Date
===========

[](#jalali-date)

Jalali date &amp; time is an extension for yii2.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist mohammad-mahdy/yii2-jdate "*"

```

or add

```
"mohammad-mahdy/yii2-jdate": "*"

```

to the require section of your `composer.json` file.

Usage of `DateTime`
===================

[](#usage-of-datetime)

Once the extension is installed, add it as a component :

```
'jdate' => [
	'class' => 'jDate\DateTime'
]
```

Now you can use in your project:

```
Yii::$app->jdate->date('Y-m-d');
```

You can access dates and times as variable :

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

Usage of `DatePicker`
=====================

[](#usage-of-datepicker)

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

A basic usage:

```
