Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-3509

fullcalendar doesn't show calendar name (used to show as checkboxes)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.0.0-RC1
    • None
    • None

    Description

      to reproduce in the starter app,

      make SimpleObject implement Calenderable (rather than CalendarEventable):

      @Override
      public Set<String> getCalendarNames() {
          return _Sets.of("Check-in", "Check-out");
      }
      
      @Override
      public Map<String, CalendarEventable> getCalendarEvents() {
          return _Maps.unmodifiable(
                  "Check-in",  new MyCalendarEventable("Check-in",  () -> getLastCheckedIn()),
                  "Check-out", new MyCalendarEventable("Check-out", () -> getLastCheckedIn().plusDays(5))
                  );
      }
      
      @SuppressWarnings("CdiManagedBeanInconsistencyInspection")
      @RequiredArgsConstructor
      class MyCalendarEventable implements CalendarEventable {
      
          private final String calendarName;
          private final Supplier<LocalDate> localDateSupplier;
      
          @Override
          public String getCalendarName() {
              return calendarName;
          }
      
          @Override
          public CalendarEvent toCalendarEvent() {
              LocalDate localDate = localDateSupplier.get();
              return localDate != null
                      ? toCalendarEvent(localDate)
                      : null;
          }
      
          private CalendarEvent toCalendarEvent(LocalDate localDate) {
              ZoneRules zoneRules = clockService.getClock().nowAsOffsetDateTime().toZonedDateTime().getZone().getRules();
              long epochMillis = localDate.toEpochSecond(LocalTime.MIDNIGHT,
                      zoneRules.getOffset(localDate.atStartOfDay())) * 1000L;
              return new CalendarEvent(epochMillis, calendarName, titleService.titleOf(SimpleObject.this), getNotes());
          }
      }
       

      is then rendered as:

      We do see that both the events for each domain object are shown, and in different colours, .... but I recall that there used to be a legend to say what the colours meant, and a checkbox to show or hide each such "calendar".

       

      IN ADDITION:

      • the "notes" property of the `CalendarEvent`  I think is meant to be for a tooltip, but isn't shown
      • the mouse cursor changes to an 'edit bar' when hovering over, but should be a hand cursor (to indicate that the end-user can click on the object).

       

       

      Attachments

        1. image-2023-07-02-11-19-46-180.png
          92 kB
          Daniel Keir Haywood

        Activity

          People

            Unassigned Unassigned
            danhaywood Daniel Keir Haywood
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: