aboutsummaryrefslogtreecommitdiffstats
path: root/demos
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:05:27 -0400
commit6a665a1377fd62306c6fb4ff96613fe31964ecf4 (patch)
tree4105f5f562e17ae35d842fffd1344eff58333d37 /demos
parent17d7f2be486a77b0603bf7a3384632d1ef38a87f (diff)
downloadjquery-ui-6a665a1377fd62306c6fb4ff96613fe31964ecf4.tar.gz
jquery-ui-6a665a1377fd62306c6fb4ff96613fe31964ecf4.zip
Datepicker range demo: Use public APIs. Fixes #8292 - Double Click on from date in Date range datepicker.
(cherry picked from commit f6c0b71ae9cbed55bdcfd8058a4c89fee0b4c068)
Diffstat (limited to 'demos')
-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 );
}
});
});