Skip to content

Commit d064f37

Browse files
committed
Merge branch 'pr/128'
2 parents 447be36 + f53d0e3 commit d064f37

File tree

4 files changed

+181
-112
lines changed

4 files changed

+181
-112
lines changed

daterangepicker.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
line-height:1;
8989
font-size:12px;
9090
margin-bottom:1px;
91-
color:#999;
91+
color: #ccc;
9292
cursor:default;
9393
}
9494
.date-picker-wrapper .month-wrapper table div.day.lastMonth,

demo.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ $(function()
276276
showShortcuts: false
277277
});
278278

279-
$('#date-range14-2').dateRangePicker(
279+
$('#date-range14-2').dateRangePicker(
280280
{
281281
batchMode: 'week-range',
282282
showShortcuts: false
@@ -386,6 +386,12 @@ $(function()
386386
showTopbar: false
387387
});
388388

389+
$('#date-range5-2').dateRangePicker(
390+
{
391+
minDays:3,
392+
maxDays:7
393+
});
394+
389395
$('#date-range24').dateRangePicker(
390396
{
391397
showWeekNumbers: true
@@ -418,5 +424,18 @@ $(function()
418424
selectBackward: true
419425
});
420426

427+
$('#hotel-booking').dateRangePicker(
428+
{
429+
startDate: new Date(),
430+
selectForward: true,
431+
beforeShowDay: function(t)
432+
{
433+
var valid = !(t.getDay() == 0 || t.getDay() == 6); //disable saturday and sunday
434+
var _class = '';
435+
var _tooltip = valid ? '' : 'sold out';
436+
return [valid,_class,_tooltip];
437+
}
438+
});
439+
421440

422441
});

index.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@ <h2>Demonstrations</h2>
130130
} </pre>
131131
</div>
132132

133+
<div class="demo">
134+
Limit date range selected between 3 days to 7 days: <input id="date-range5-2" size="40" value="">
135+
<a href="#" class="show-option">Show Config</a>
136+
<pre class="options">
137+
{
138+
maxDays: 7,
139+
minDays: 3
140+
} </pre>
141+
</div>
142+
133143
<div class="demo">
134144
Select a date range between 2013-01-10 to 2013-02-10: <input id="date-range6" size="40" value="">
135145
<a href="#" class="show-option">Show Config</a>
@@ -550,6 +560,30 @@ <h2>Demonstrations</h2>
550560
}</pre>
551561
</div>
552562

563+
<div class="demo">
564+
Typical usage, hotel booking: <input id="hotel-booking" size="60" value="">
565+
<a href="#" class="show-option">Show Config</a>
566+
<pre class="options">
567+
{
568+
startDate: new Date(),
569+
selectForward: true,
570+
showDateFilter: function(time, date)
571+
{
572+
return '&lt;div style="padding:0 5px;">\
573+
&lt;span style="font-weight:bold">'+date+'&lt;/span>\
574+
&lt;div style="opacity:0.3;">$'+Math.round(Math.random()*999)+'&lt;/div>\
575+
&lt;/div>';
576+
},
577+
beforeShowDay: function(t)
578+
{
579+
var valid = !(t.getDay() == 0 || t.getDay() == 6); //disable saturday and sunday
580+
var _class = '';
581+
var _tooltip = valid ? '' : 'sold out';
582+
return [valid,_class,_tooltip];
583+
}
584+
} </pre>
585+
</div>
586+
553587

554588
<h2>Configuration</h2>
555589
<pre><b>Usage:</b> $('#dom-id').dateRangePicker(configObject);</pre>

0 commit comments

Comments
 (0)