Opened 14 years ago

Closed 14 years ago

Last modified 10 years ago

#3543 closed bug (wontfix)

Multiple inline datepickers, change options of another datepicker, does not redraw/refresh

Reported by: robin Owned by: grabanski
Priority: minor Milestone:
Component: ui.datepicker Version: 1.6rc2
Keywords: Cc:
Blocked by: Blocking:


An expansion to ticket #3159

Consider 2 inline datepickers:

<script src="../media/js/jquery.js" type="text/javascript"></script>

<script src="../media/js/ui.datepicker.min.js" type="text/javascript"></script>

<link href="../media/css/ui.datepicker.css" type="text/css" rel="stylesheet"></script>

<input id="start" /><div id="start_div"></div>

<input id="end" /><div id="end_div"></div>






var min_date=new Date(new Date($('#start').val()).getTime()+1*24*60*60*1000) +1 day $('#end_div').data('minDate.datepicker',min_date)


}) $('#end_div').datepicker({





}) </script>

Select a date from the start calendar and then the end calendar seems to have its minDate property updated, BUT does not redraw to show the changes UNLESS you click a date on the end calendar.

Should the redraw be automatic? Or is there a function to refresh it manually $.datepicker._refreshDatepicker($('#end_div')) which doesn't work ?

Change History (3)

comment:1 Changed 14 years ago by kbwood

Resolution: wontfix
Status: newclosed

Use the 'change' command to change the datepicker settings instead of data(), i.e. $('#end_div').datepicker('change', {minDate: min_date}).

Also see the 'Another Date Range' example on the datepicker functional demos page for a synchronised date range across two input fields.

comment:2 Changed 14 years ago by robin

'change' command, as your example demonstrates, works. The other datepicker redraws automatically. Thank you.

comment:3 Changed 10 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.