Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calendar and first day of week
Hello,
I've added a calendar to a Liferay portlet.
I want to only display days from Monday 'til Friday so I configured the calendar as follows:
calendar.setFirstVisibleDayOfWeek(java.util.Calendar.MONDAY);
calendar.setLastVisibleDayOfWeek(java.util.Calendar.FRIDAY);
this works fine as long as I use the English locale. When the user switches to a different locale (e.g. French or German), the suddenly the calendar shows days from Tuesday 'til Saturday.
I wonder if that's related to the following facts:
java.util.Calendar.MONDAY has the value 2 and java.util.Calendar.FRIDAY has the value 6.
With the English locale the week starts on Sunday but in French and German locale, the week starts on Monday thus there is an offset by one day.
So what would be the best way to make the calendar always show the days from Monday - Friday, regardless of the Locale the user has selected?
Many thanks in advance for your support.
Alex
Hello
i have the same Problem here (vice versa)
With my german firefox i get the Mondy as the first day of week. With the english Version - it's the Sunday.
Are there any Solutions?
Thx
Peter