aboutsummaryrefslogtreecommitdiffstats
path: root/demos/datepicker/date-range.html
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-05-03 09:04:52 -0400
committerScott González <scott.gonzalez@gmail.com>2012-05-03 09:04:52 -0400
commitf6c0b71ae9cbed55bdcfd8058a4c89fee0b4c068 (patch)
tree0a52141bb2751e0900a8330788cc72501c0d8ec3 /demos/datepicker/date-range.html
parentefe53f586fa5f74503a163008459083942c54a03 (diff)
downloadjquery-ui-f6c0b71ae9cbed55bdcfd8058a4c89fee0b4c068.tar.gz
jquery-ui-f6c0b71ae9cbed55bdcfd8058a4c89fee0b4c068.zip
Datepicker range demo: Use public APIs. Fixes #8292 - Double Click on from date in Date range datepicker.
Diffstat (limited to 'demos/datepicker/date-range.html')
-rw-r--r--demos/datepicker/date-range.html18
1 files changed, 10 insertions, 8 deletions
diff --git a/demos/datepicker/date-range.html b/demos/datepicker/date-range.html
index f939e8e93..09ebba842 100644
--- a/demos/datepicker/date-range.html
+++ b/demos/datepicker/date-range.html
@@ -11,18 +11,20 @@
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
- var dates = $( "#from, #to" ).datepicker({
+ $( "#from" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 3,
onSelect: function( selectedDate ) {
- var option = this.id == "from" ? "minDate" : "maxDate",
- instance = $( this ).data( "datepicker" ),
- date = $.datepicker.parseDate(
- instance.settings.dateFormat ||
- $.datepicker._defaults.dateFormat,
- selectedDate, instance.settings );
- dates.not( this ).datepicker( "option", option, date );
+ $( "#to" ).datepicker( "option", "minDate", selectedDate );
+ }
+ });
+ $( "#to" ).datepicker({
+ defaultDate: "+1w",
+ changeMonth: true,
+ numberOfMonths: 3,
+ onSelect: function( selectedDate ) {
+ $( "#from" ).datepicker( "option", "maxDate", selectedDate );
}
});
});