summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorMatti Tahvonen <matti@vaadin.com>2013-10-23 17:28:55 +0300
committerVaadin Code Review <review@vaadin.com>2013-11-04 09:23:42 +0000
commit186696d7a7428458cf9471b4e5f29cb3d83cffa2 (patch)
tree386893de5e4c89bd0535d835517adb67821c9ca7 /client
parent7615fd1d1b248a612aa796f7621321040a795a55 (diff)
downloadvaadin-framework-186696d7a7428458cf9471b4e5f29cb3d83cffa2.tar.gz
vaadin-framework-186696d7a7428458cf9471b4e5f29cb3d83cffa2.zip
fix regression related to #12504
Cloning date instances passed from state to cal panel as they appear to be mutating Change-Id: I3775b8445ddc0a779b894b4e044bde93f4c5936c
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/VCalendarPanel.java13
-rw-r--r--client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java4
2 files changed, 9 insertions, 8 deletions
diff --git a/client/src/com/vaadin/client/ui/VCalendarPanel.java b/client/src/com/vaadin/client/ui/VCalendarPanel.java
index 58e0448b5f..96678fd133 100644
--- a/client/src/com/vaadin/client/ui/VCalendarPanel.java
+++ b/client/src/com/vaadin/client/ui/VCalendarPanel.java
@@ -56,6 +56,7 @@ import com.vaadin.client.DateTimeService;
import com.vaadin.client.Util;
import com.vaadin.client.VConsole;
import com.vaadin.shared.ui.datefield.Resolution;
+import com.vaadin.shared.util.SharedUtil;
@SuppressWarnings("deprecation")
public class VCalendarPanel extends FocusableFlexTable implements
@@ -2214,9 +2215,9 @@ public class VCalendarPanel extends FocusableFlexTable implements
* @param startDate
* - the allowed range's start date
*/
- public void setRangeStart(Date rangeStart) {
- if (this.rangeStart != rangeStart) {
- this.rangeStart = rangeStart;
+ public void setRangeStart(Date newRangeStart) {
+ if (!SharedUtil.equals(rangeStart, newRangeStart)) {
+ rangeStart = newRangeStart;
if (initialRenderDone) {
// Dynamic updates to the range needs to render the calendar to
// update the element stylenames
@@ -2233,9 +2234,9 @@ public class VCalendarPanel extends FocusableFlexTable implements
* @param endDate
* - the allowed range's end date
*/
- public void setRangeEnd(Date rangeEnd) {
- if (this.rangeEnd != rangeEnd) {
- this.rangeEnd = rangeEnd;
+ public void setRangeEnd(Date newRangeEnd) {
+ if (!SharedUtil.equals(rangeEnd, newRangeEnd)) {
+ rangeEnd = newRangeEnd;
if (initialRenderDone) {
// Dynamic updates to the range needs to render the calendar to
// update the element stylenames
diff --git a/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java b/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java
index f018caefa5..a82bfd1391 100644
--- a/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java
+++ b/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java
@@ -178,8 +178,8 @@ public class PopupDateFieldConnector extends TextualDateConnector {
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
getWidget().setTextFieldEnabled(getState().textFieldEnabled);
- getWidget().setRangeStart(getState().rangeStart);
- getWidget().setRangeEnd(getState().rangeEnd);
+ getWidget().setRangeStart((Date) getState().rangeStart.clone());
+ getWidget().setRangeEnd((Date) getState().rangeEnd.clone());
}
@Override