aboutsummaryrefslogtreecommitdiffstats
path: root/client/tests/src/com
diff options
context:
space:
mode:
authorTeemu Pòˆntelin <teemu@vaadin.com>2014-08-17 23:24:28 +0300
committerVaadin Code Review <review@vaadin.com>2014-08-20 12:44:15 +0000
commit2003a71fcd970455d98d8f490158d2daf89d641d (patch)
tree1739b76706ac6537453df71a8630b41d0941d93e /client/tests/src/com
parent849894ae8d61cea654e25533be175a2173679921 (diff)
downloadvaadin-framework-2003a71fcd970455d98d8f490158d2daf89d641d.tar.gz
vaadin-framework-2003a71fcd970455d98d8f490158d2daf89d641d.zip
Fixed incorrect week numbers in DateField (#14437)
Daylight saving time caused problems with the week number calculation in the DateTimeService.getISOWeekNumber(Date d) method. If the given date was inside a DST period, there was a rounding error when calculating the number of days from the beginning of the year. As a result the week numbers were calculated incorrectly in a case where the year started with a Thursday (like for example 2015 and 2026). Change-Id: Ib3d045ea0b9a1acc44b6f28487b064b3c2b76bb9
Diffstat (limited to 'client/tests/src/com')
-rwxr-xr-xclient/tests/src/com/vaadin/client/DateTimeServiceTest.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/client/tests/src/com/vaadin/client/DateTimeServiceTest.java b/client/tests/src/com/vaadin/client/DateTimeServiceTest.java
index 3f4828678f..f9351d1cc0 100755
--- a/client/tests/src/com/vaadin/client/DateTimeServiceTest.java
+++ b/client/tests/src/com/vaadin/client/DateTimeServiceTest.java
@@ -48,6 +48,16 @@ public class DateTimeServiceTest extends TestCase {
isoWeekNumbers.put(getDate(2010, 1, 4), 1);
isoWeekNumbers.put(getDate(2010, 1, 5), 1);
isoWeekNumbers.put(getDate(2010, 10, 10), 40);
+ isoWeekNumbers.put(getDate(2015, 3, 24), 13);
+ isoWeekNumbers.put(getDate(2015, 3, 31), 14);
+ isoWeekNumbers.put(getDate(2015, 10, 13), 42);
+ isoWeekNumbers.put(getDate(2015, 10, 20), 43);
+ isoWeekNumbers.put(getDate(2015, 10, 27), 44);
+ isoWeekNumbers.put(getDate(2026, 3, 24), 13);
+ isoWeekNumbers.put(getDate(2026, 3, 31), 14);
+ isoWeekNumbers.put(getDate(2026, 10, 13), 42);
+ isoWeekNumbers.put(getDate(2026, 10, 20), 43);
+ isoWeekNumbers.put(getDate(2026, 10, 27), 44);
}