Interface Calendar<V>

Type Parameters:
V - type of value
All Superinterfaces:
Component, Component.BelongToFrame, Component.HasCaption, Component.HasDescription, Component.HasIcon, HasContextHelp, HasDatatype<V>, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer
All Known Implementing Classes:
CalendarImpl

@StudioComponent(caption="Calendar", category="Components", xmlElement="calendar", icon="io/jmix/ui/icon/component/calendar.svg", canvasBehaviour=CALENDAR, documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/vcl/components/calendar.html") public interface Calendar<V> extends Component.BelongToFrame, Component.HasCaption, Component.HasIcon, HasContextHelp, HasHtmlCaption, HasHtmlDescription, HasDatatype<V>, HasHtmlSanitizer
Calendar is used for visualizing events in a calendar using week or month view.
  • Field Details

  • Method Details

    • setStartDate

      @StudioProperty(name="startDate", type=DATE) void setStartDate(@Nullable V date)
      Set start date for the calendar range.
    • getStartDate

      @Nullable V getStartDate()
      Returns:
      the start date for the calendar range.
    • setEndDate

      @StudioProperty(name="endDate", type=DATE) void setEndDate(@Nullable V date)
      Set end date for the calendar's range.
    • getEndDate

      @Nullable V getEndDate()
      Returns:
      the last date for the calendar range.
    • setTimeZone

      void setTimeZone(TimeZone zone)
      Set timezone.
    • getTimeZone

      TimeZone getTimeZone()
      Returns:
      timezone.
    • setTimeFormat

      @StudioProperty(name="timeFormat", type=ENUMERATION, defaultValue="24H", options={"12H","24H"}) void setTimeFormat(Calendar.TimeFormat format)
      Set format for time. 12H/24H.
    • getTimeFormat

      Calendar.TimeFormat getTimeFormat()
      Returns:
      enumeration of ite format.
    • setFirstVisibleDayOfWeek

      @StudioProperty(name="firstVisibleDayOfWeek", defaultValue="1") @Min(1L) @Max(7L) void setFirstVisibleDayOfWeek(int firstDay)
      Set first day of the week to show.
    • getFirstVisibleDayOfWeek

      int getFirstVisibleDayOfWeek()
      Returns:
      first showed day of the week.
    • setLastVisibleDayOfWeek

      @StudioProperty(name="lastVisibleDayOfWeek", defaultValue="7") @Min(1L) @Max(7L) void setLastVisibleDayOfWeek(int lastDay)
      Set last day of the week to show.
    • getLastVisibleDayOfWeek

      int getLastVisibleDayOfWeek()
      Returns:
      last showed day of the week.
    • setFirstVisibleHourOfDay

      @StudioProperty(name="firstVisibleHourOfDay", defaultValue="0") @Min(0L) @Max(23L) void setFirstVisibleHourOfDay(int firstHour)
      Set first hour of the day to show.
    • getFirstVisibleHourOfDay

      int getFirstVisibleHourOfDay()
      Returns:
      first showed hour of the day.
    • setLastVisibleHourOfDay

      @StudioProperty(name="lastVisibleHourOfDay", defaultValue="23") @Min(0L) @Max(23L) void setLastVisibleHourOfDay(int lastHour)
      Set last hour of the day to show.
    • getLastVisibleHourOfDay

      int getLastVisibleHourOfDay()
      Returns:
      last showed hour of the day.
    • setFirstDayOfWeek

      void setFirstDayOfWeek(Integer dayOfWeek)
      Allows setting first day of week independent of Locale.

      Pass null to use a day of week defined by current locale.

      Parameters:
      dayOfWeek - any of java.util.Calendar.SUNDAY ... java.util.Calendar.SATURDAY or null to revert to default first day of week by locale
    • setWeeklyCaptionFormat

      @StudioProperty(name="weeklyCaptionFormat", type=DATE_FORMAT) void setWeeklyCaptionFormat(String dateFormatPattern)
      Set date caption format for the weekly view.
    • getWeeklyCaptionFormat

      String getWeeklyCaptionFormat()
      Returns:
      date pattern of captions.
    • setEventProvider

      void setEventProvider(@Nullable CalendarEventProvider calendarEventProvider)
      Set the calendar event provider. Provider can contain calendar events.
      Parameters:
      calendarEventProvider - an event provider with events
      See Also:
    • getEventProvider

      CalendarEventProvider getEventProvider()
      Returns:
      calendar event provider.
    • setNavigationButtonsVisible

      @StudioProperty(name="navigationButtonsVisible", defaultValue="false") void setNavigationButtonsVisible(boolean value)
      Set visibility for the backward and forward buttons.
    • isNavigationButtonsVisible

      boolean isNavigationButtonsVisible()
      Returns:
      backward and forward buttons visibility.
    • getDayNames

      Map<DayOfWeek,String> getDayNames()
      Returns:
      DayOfWeek values matched to localized day names
    • setDayNames

      void setDayNames(Map<DayOfWeek,String> dayNames)
      Sets localized Calendar day names.
      Parameters:
      dayNames - DayOfWeek values matched to localized day names
    • getMonthNames

      Map<Month,String> getMonthNames()
      Returns:
      Month values matched to localized month names
    • setMonthNames

      void setMonthNames(Map<Month,String> monthNames)
      Sets localized Calendar month names.
      Parameters:
      monthNames - Month values matched to localized month names
    • addDateClickListener

      Subscription addDateClickListener(Consumer<Calendar.CalendarDateClickEvent<V>> listener)
      Adds a listener that is invoked when the user clicks on a day number of the month.
      Parameters:
      listener - a listener to add
      Returns:
      a registration object for removing an event listener
    • addEventClickListener

      Subscription addEventClickListener(Consumer<Calendar.CalendarEventClickEvent<V>> listener)
      Adds a listener that is invoked when the user clicks on an event.
      Parameters:
      listener - a listener to add
      Returns:
      a registration object for removing an event listener
    • addEventResizeListener

      Subscription addEventResizeListener(Consumer<Calendar.CalendarEventResizeEvent<V>> listener)
      Adds a listener that is invoked when the user changes an event duration.
      Parameters:
      listener - a listener to add
      Returns:
      a registration object for removing an event listener
    • addEventMoveListener

      Subscription addEventMoveListener(Consumer<Calendar.CalendarEventMoveEvent<V>> listener)
      Adds a listener that is invoked when the user changes an event position.
      Parameters:
      listener - a listener to add
      Returns:
      a registration object for removing an event listener
    • addWeekClickListener

      Subscription addWeekClickListener(Consumer<Calendar.CalendarWeekClickEvent<V>> listener)
      Adds a listener that is invoked when the user clicks on a week number.
      Parameters:
      listener - a listener to add
      Returns:
      a registration object for removing an event listener
    • addForwardClickListener

      Subscription addForwardClickListener(Consumer<Calendar.CalendarForwardClickEvent<V>> listener)
      Adds a listener that is invoked when the user clicks forward navigation button.
      Parameters:
      listener - a listener to add
      Returns:
      a registration object for removing an event listener
    • addBackwardClickListener

      Subscription addBackwardClickListener(Consumer<Calendar.CalendarBackwardClickEvent<V>> listener)
      Adds a listener that is invoked when the user clicks backward navigation button.
      Parameters:
      listener - a listener to add
      Returns:
      a registration object for removing an event listener
    • addRangeSelectListener

      Subscription addRangeSelectListener(Consumer<Calendar.CalendarRangeSelectEvent<V>> listener)
      Adds a listener that is invoked when the user drag-marks day or time cells using mouse.
      Parameters:
      listener - a listener to add
      Returns:
      a registration object for removing an event listener
    • addDayClickListener

      Subscription addDayClickListener(Consumer<Calendar.CalendarDayClickEvent<V>> listener)
      Adds a listener that is invoked when the user clicks on an empty space in the day.
      Parameters:
      listener - a listener to add
      Returns:
      a registration object for removing an event listener