Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#5676 closed bug (fixed)

DatePicker Dialog defaultDate incorrect behaviour

Reported by: dsdsico Owned by:
Priority: critical Milestone: 1.8.3
Component: ui.datepicker Version: 1.8.1
Keywords: incorrect defaultDate popup behaviour Cc:
Blocked by: Blocking:

Description

The following code displays the defaultDate just fine:

<script type="text/javascript">
// Datepicker
$('.datepicker').datepicker({
   defaultDate: new Date(2010, 4, 25)
});
</script>

<div class="datepicker"></div>

However, as soon as I want to use the popup behaviour by changing the DIV element into a INPUT element, the defaultDate only gets a rollover state, which is gone as soon as I hover my mouse over the calendar (the javascript remains the same):

<input class="datepicker" />

I attached two screenshots of the situation: the first (correct) one displays an inline calendar with the selected date set to 25/5/2010 (although I initialized a Date() object with 25/4/2010, is this another bug?), the second (incorrect) one displays a popup calendar, where day 25 is merely hovered instead of selected.

I also attached index.html demonstrating the issue.

Thanks

Attachments (1)

ticket-5676-demonstration.zip (138.7 KB) - added by dsdsico 13 years ago.
HTML / JS / CSS + 2 screenshots demonstrating the issue

Download all attachments as: .zip

Change History (5)

Changed 13 years ago by dsdsico

HTML / JS / CSS + 2 screenshots demonstrating the issue

comment:2 Changed 13 years ago by afcapel

I've made a simple patch that seems to solve the issue:

http://github.com/afcapel/jquery-ui/commit/d2c046ca2654118b340cad96f87c68a470125cac

Hope it helps!

comment:3 Changed 13 years ago by rdworth

Resolution: fixed
Status: newclosed

Thanks afcapel. Fixed in eb13c01

comment:4 Changed 13 years ago by Scott González

Milestone: 1.91.8.3
Note: See TracTickets for help on using tickets.