Calendar weekly view first day problem

I’m using com.vaadin.ui.Calendar with 7.3.7 vaadin version. I set it up the following way:

setLocale(new Locale(“hu”, “HU”));

java.util.Calendar cal = java.util.Calendar.getInstance(TimeZone.getTimeZone(“Europe/Budapest”), new Locale(“hu”, “HU”));
cal.set(java.util.Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek());

cal.add(java.util.Calendar.DAY_OF_WEEK, 6);

This way it shows a week starting from monday (which is always what I want) but if I moving to other months the first day becomes sunday (when moving forward) and tuesday (when moving backward).

Can anyone suggest me how to set up the calendar correctly, so it will always show monday-sunday weeks?

I found the solution modifying
Replaced the following code:

// calculate amount to move forward int durationInDays = (int) (((end.getTime()) - start.getTime()) / DateConstants.DAYINMILLIS); // for week view durationInDays = 7, for day view durationInDays = 1 durationInDays++; To

int durationInDays = 7;