Some places(country) start the week with Sunday, some with Monday, maybe some with others, IDK, some this magic let java library find the right one for us. Calculez le jour de début de la semaine locale (lundi, dimanche et plus)
DayOfWeek firstDayOfWeek = WeekFields.of(locale).getFirstDayOfWeek();
LocalDate firstDay = today.with(TemporalAdjusters.previousOrSame(firstDayOfWeek));
*only serve as memo so actual syntax may break
Recommended Posts