hi
im trying to show working ours in the calendar. I can put a label above the calendar of cause, but for readability I want to use a recurrent event placed in the morning or setBusinessHours?? Is that once suppoesed to be used for something like that?
I tried this but it has not visible effect as far as I can tell:
calendar.setBusinessHours(new BusinessHours(LocalTime.of(9, 0), LocalTime.of(16, 0),DayOfWeek.MONDAY),
new BusinessHours(LocalTime.of(9, 0), LocalTime.of(16, 0),DayOfWeek.TUESDAY),
new BusinessHours(LocalTime.of(9, 0), LocalTime.of(16, 0),DayOfWeek.WEDNESDAY),
new BusinessHours(LocalTime.of(9, 0), LocalTime.of(16, 0),DayOfWeek.THURSDAY),
new BusinessHours(LocalTime.of(10, 0), LocalTime.of(14, 0),DayOfWeek.FRIDAY));
I also tried this:
entry.setTitle("Mandag til torsdag 8-14:30");
entry.setRecurringStartDate(LocalDate.of(2020, 1,1), Timezone.getSystem());
entry.setRecurringEndDate(LocalDate.of(2022, 1,1), Timezone.getSystem());
entry.setStart(LocalDateTime.now().withHour(7).withMinute(0));
entry.setEnd(LocalDateTime.now().withHour(8).withMinute(0));
entry.setRecurring(true);
entry.setRecurringDaysOfWeeks(new HashSet<DayOfWeek>(){{ DayOfWeek.MONDAY.getValue(); DayOfWeek.TUESDAY.getValue();DayOfWeek.WEDNESDAY.getValue();DayOfWeek.THURSDAY.getValue(); }});
and added this to the calendar - but it does not show up in the calendar as far as I can tell (probably the last line is incorrect?).
also tried:
entry.setRecurringDaysOfWeeks(new HashSet( Arrays.asList(DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY, DayOfWeek.THURSDAY )));