PHP code example of faravaghi / yii2-jalali-daterangepicker

1. Go to this page and download the library: Download faravaghi/yii2-jalali-daterangepicker 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/ */

    

faravaghi / yii2-jalali-daterangepicker example snippets


<?= 
use faravaghi\jalaliDateRangePicker\jalaliDateRangePicker;

echo $form->field(
	$model, 
	'findDate'
)
->widget(jalaliDateRangePicker::classname(),[
	'options'  => [
		'format' => 'jYYYY/jMM/jDD',
		'viewformat' => 'jYYYY/jMM/jDD',
		// 'minDate' => '1394/10/17',
		'placement' => 'right',
		'opens' => 'left',
		'showDropdowns'=> true,
		// 'timePicker' => true,
		// 'timePicker24Hour' => true,
		'locale'=>[
			'format'=> 'jYYYY/jMM/jDD',
			'separator'=> ' - ',
			'applyLabel'=> Yii::t('zii', 'Apply'),
			'cancelLabel' => Yii::t('zii', 'Cancel'),
			'fromLabel' => Yii::t('zii', 'From'),
			'toLabel' => Yii::t('zii', 'To'),
			'customRangeLabel' => 'Custom',
			'daysOfWeek'=>[
				'یک',
				'دو',
				'سه',
				'چهار',
				'پنج',
				'جمعه',
				'شنبه',
			],
			'monthNames'=>[
				'فروردین',
				'اردیبهشت',
				'خرداد',
				'تیر',
				'مرداد',
				'شهریور',
				'مهر',   
				'آبان',
				'آذر',
				'دی',
				'بهمن',
				'اسفند',
			],
			'firstDay' => 6
		],
	],
	'htmlOptions' => [
		'class'	=> 'form-control',
		'id' => 'objects-findDate'
	]
]);


php composer.phar