diff options
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java index 5420a2df65..0f45e7185b 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java @@ -1196,8 +1196,9 @@ public class VCalendarPanel extends FocusableFlexTable implements if (value == null) { focusedDate = displayedMonth = null; } else { - focusedDate = (Date) value.clone(); - displayedMonth = (Date) value.clone(); + focusedDate = new Date(value.getYear(), value.getMonth(), + value.getDate()); + displayedMonth = new Date(value.getYear(), value.getMonth(), 1); } // Re-render calendar if month or year of focused date has changed @@ -1211,7 +1212,7 @@ public class VCalendarPanel extends FocusableFlexTable implements } if (!hasFocus) { - focusDay((Date) null); + focusDay(null); } } |