diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2014-10-04 00:03:38 +0300 |
---|---|---|
committer | Sauli Tähkäpää <sauli@vaadin.com> | 2014-11-10 13:20:11 +0200 |
commit | fead7a7435a360776a93df55e5e9ca9e24fa3fd0 (patch) | |
tree | ad8cef06f5ec6f1db4f4b5ecee4a68bbab44ffe1 /client | |
parent | ef8d1ecf8765ce68bbe69021b90f3377ef8d201a (diff) | |
download | vaadin-framework-fead7a7435a360776a93df55e5e9ca9e24fa3fd0.tar.gz vaadin-framework-fead7a7435a360776a93df55e5e9ca9e24fa3fd0.zip |
Fix VCalendar to use correct year of week. (#14783)
Change-Id: Id55ad5ed620bd5c187b70ae2a2d0a4c4adea382a
Diffstat (limited to 'client')
3 files changed, 9 insertions, 3 deletions
diff --git a/client/src/com/vaadin/client/ui/VCalendar.java b/client/src/com/vaadin/client/ui/VCalendar.java index f0f1bc89ca..c59a78108c 100644 --- a/client/src/com/vaadin/client/ui/VCalendar.java +++ b/client/src/com/vaadin/client/ui/VCalendar.java @@ -588,7 +588,7 @@ public class VCalendar extends Composite implements VHasDropHandler { int x = pos - (y * columns); if (x == 0 && daysCount > 7) { // Add week to weekToolbar for navigation - weekToolbar.addWeek(week, d.getYear()); + weekToolbar.addWeek(week, day.getYearOfWeek()); } final SimpleDayCell cell = new SimpleDayCell(this, y, x); cell.setMonthGrid(monthGrid); diff --git a/client/src/com/vaadin/client/ui/calendar/CalendarConnector.java b/client/src/com/vaadin/client/ui/calendar/CalendarConnector.java index cbf63768a3..8f5e9d9a59 100644 --- a/client/src/com/vaadin/client/ui/calendar/CalendarConnector.java +++ b/client/src/com/vaadin/client/ui/calendar/CalendarConnector.java @@ -675,7 +675,7 @@ public class CalendarConnector extends AbstractComponentConnector implements List<CalendarDay> list = new ArrayList<CalendarDay>(days.size()); for (CalendarState.Day day : days) { CalendarDay d = new CalendarDay(day.date, day.localizedDateFormat, - day.dayOfWeek, day.week); + day.dayOfWeek, day.week, day.yearOfWeek); list.add(d); } diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/CalendarDay.java b/client/src/com/vaadin/client/ui/calendar/schedule/CalendarDay.java index 44b82f166f..0fceb6b6f9 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/CalendarDay.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/CalendarDay.java @@ -27,14 +27,16 @@ public class CalendarDay { private String localizedDateFormat; private int dayOfWeek; private int week; + private int yearOfWeek; public CalendarDay(String date, String localizedDateFormat, int dayOfWeek, - int week) { + int week, int yearOfWeek) { super(); this.date = date; this.localizedDateFormat = localizedDateFormat; this.dayOfWeek = dayOfWeek; this.week = week; + this.yearOfWeek = yearOfWeek; } public String getDate() { @@ -52,4 +54,8 @@ public class CalendarDay { public int getWeek() { return week; } + + public int getYearOfWeek() { + return yearOfWeek; + } } |