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.
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?