PHP code example of elephantsgroup / eg-jdate

1. Go to this page and download the library: Download elephantsgroup/eg-jdate 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/ */

    

elephantsgroup / eg-jdate example snippets


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

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

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

<?= jDate\DatePicker::widget([
	'name' => 'datepicker'
]) 

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

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

<?= $form->field($model, 'fieldname')->widget(jDate\DatePicker::className()) 

[
	'cellHeight' => 13,
	'cellWidth'  => 13
]

[
	'fontSize' => 25
]

[
	'persianNumbers' => false
]

[
	'formatDate' => 'DD-NM-YYYY hh:m'
]

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

<?= jDate\DatePicker::widget([
	'model' => $model, 'attribute' => 'date',
	'ClientOptions' => [
		'onHide' => 'function(){alert("Datepicker is now hidden!")}'
	]
]) 

<?= jDate\DatePicker::widget([
	'model' => $model, 'attribute' => 'date',
	'ClientOptions' => [
		'onSelect' => 'function(){alert("Date selected!")}'
	]
]) 

<?= jDate\DatePicker::widget([
	'model' => $model, 'attribute' => 'date',
	'ClientOptions' => [
		'onShow' => 'function(){alert("Hello!")}'
	]
]) 

php composer.phar