[ 
https://issues.apache.org/jira/browse/WICKET-2941?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michel DAVID updated WICKET-2941:
---------------------------------

    Attachment: patch.txt

Proposed patch

> DatePicker fail with "firstDate is undefined" when an out of range date is 
> written in the textfield
> ---------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-2941
>                 URL: https://issues.apache.org/jira/browse/WICKET-2941
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-datetime
>    Affects Versions: 1.4.8
>            Reporter: Michel DAVID
>         Attachments: patch.txt
>
>
> When a DatePicker is configured with a range (mindate and maxdate) and the 
> user enter a date out of the range in the textfield and click on the 
> datepicker icon there is an javascript error and the calendar don't pop up.
> There is a "firstDate is undefined" in this javascript method (line with 
> widget.cfg.setProperty)
> Wicket.DateTime.showCalendar = function(widget, date, datePattern) {
>   if (date) {
>     date = Wicket.DateTime.parseDate(datePattern, date);
>     if (!isNaN(date)) {
>       widget.select(date);
>       firstDate = widget.getSelectedDates()[0];
>       widget.cfg.setProperty("pagedate", (firstDate.getMonth() + 1) + "/" + 
> firstDate.getFullYear());
>       widget.render();
>     }
>   }
>   widget.show();
> } 
> To fix the issue you can test the firstDate value after getSelectedDates 
> call. YUI Calendar return undefined value when the selected date is out of 
> the range.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to