mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Datepicker range demo: Use public APIs. Fixes #8292 - Double Click on from date in Date range datepicker.
(cherry picked from commit f6c0b71ae9
)
This commit is contained in:
parent
17d7f2be48
commit
6a665a1377
@ -11,18 +11,20 @@
|
|||||||
<link rel="stylesheet" href="../demos.css">
|
<link rel="stylesheet" href="../demos.css">
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
var dates = $( "#from, #to" ).datepicker({
|
$( "#from" ).datepicker({
|
||||||
defaultDate: "+1w",
|
defaultDate: "+1w",
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
numberOfMonths: 3,
|
numberOfMonths: 3,
|
||||||
onSelect: function( selectedDate ) {
|
onSelect: function( selectedDate ) {
|
||||||
var option = this.id == "from" ? "minDate" : "maxDate",
|
$( "#to" ).datepicker( "option", "minDate", selectedDate );
|
||||||
instance = $( this ).data( "datepicker" ),
|
}
|
||||||
date = $.datepicker.parseDate(
|
});
|
||||||
instance.settings.dateFormat ||
|
$( "#to" ).datepicker({
|
||||||
$.datepicker._defaults.dateFormat,
|
defaultDate: "+1w",
|
||||||
selectedDate, instance.settings );
|
changeMonth: true,
|
||||||
dates.not( this ).datepicker( "option", option, date );
|
numberOfMonths: 3,
|
||||||
|
onSelect: function( selectedDate ) {
|
||||||
|
$( "#from" ).datepicker( "option", "maxDate", selectedDate );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user