Interface ICalendar

All Superinterfaces:
IAnyGroup<ICalendar>, IComponent<ICalendar>, IHtmlBasedComponent<ICalendar>, IXulElement<ICalendar>

public interface ICalendar extends IXulElement<ICalendar>, IAnyGroup<ICalendar>
Immutable Calendar component

A calendar.

Support @Action

Name Action Type
onWeekClick Denotes a user clicks upon a label of week of year. [ZK EE].

The First Day of the Week

The first day of the week is decided by the locale (actually the return value of the getFirstDayOfWeek method in the Calendar). You can also control the first day of the week by the use of the session attribute and the library property. Please refer to The First Day of the Week for details.

2DigitYearStart

You can control the 2DigitYearStart by the use of the library property, for example,

 <library-property>
     <name>org.zkoss.web.preferred.2DigitYearStart</name>
     <value>1950</value>
 </library-property>
 
 

Constraint

You could specify what value to accept for input controls by use of the constraint attribute. It could be a combination of no future, no past, and no today.

It also supports an interval of dates. For example,

 
 IDatebox.ofConstraint("between 20071225 and 20071203");
 IDatebox.ofConstraint("before 20071225");
 IDatebox.ofConstraint("after 20071225");
 
 
Author:
katherine
See Also:
  • Calendar
  • Field Details

    • DEFAULT

      static final ICalendar DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zul.db.Calendar"

      Specified by:
      getWidgetClass in interface IComponent<ICalendar>
    • getConstraint

      @Nullable String getConstraint()
      Returns the client constraint to validate the value entered by a user. if any.

      Default: null

    • withConstraint

      ICalendar withConstraint(@Nullable String constraint)
      Returns a copy of this immutable component with the specified constraint.

      Sets the client constraint to validate the value entered by a user; you can specify the following values or Regular Expression.

      Condition Description
      no future Date in the future is not allowed.
      no past Date in the past is not allowed.
      no today Today is not allowed.
      between yyyyMMdd and yyyyMMdd Date only allowed between the specified range. The format must be yyyyMMdd, such as
      
       ICalendar.ofConstraint("between 20211225 and 20211203");
           
      after yyyyMMdd Date only allowed after (and including) the specified date. The format must be yyyyMMdd, such as
      
       ICalendar.ofConstraint("after 20211225");
           
      before yyyyMMdd Date only allowed before (and including) the specified date. The format must be yyyyMMdd, such as
      
       ICalendar.ofConstraint("before 20211225");
           
      Parameters:
      constraint - The client constraint of the component.

      Default: null.

      Returns:
      A modified copy of the this object
    • getName

      @Nullable String getName()
      Returns the name of this component.

      Default: null.

      The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.

      Don't use this method if your application is purely based on ZK's event-driven model.

    • withName

      ICalendar withName(@Nullable String name)
      Returns a copy of this immutable component with the specified name.

      Sets the name of this component.

      The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.

      Don't use this method if your application is purely based on ZK's event-driven model.

      Parameters:
      name - The name of this component.

      Default: null.

      Returns:
      A modified copy of the this object
    • getValue

      default Date getValue()
      Returns the value that is assigned to this component, never null.

      Default: ZonedDateTime.now()

    • withValue

      ICalendar withValue(Date value)
      Returns a copy of this immutable component with the specified value.

      Assigns a value to this component.

      Parameters:
      value - The value of the calendar.

      Default: ZonedDateTime.now().

      Returns:
      A modified copy of the this object
    • getValueInZonedDateTime

      @Lazy default ZonedDateTime getValueInZonedDateTime()
      Returns the value (in ZonedDateTime) that is assigned to this component, never null.

      Default: ZonedDateTime.now()

    • withValueInZonedDateTime

      default ICalendar withValueInZonedDateTime(ZonedDateTime value)
      Returns a copy of this immutable component with the specified value.

      Assigns a value to this component.

      Parameters:
      value - The value of the calendar.

      Default: ZonedDateTime.now().

      Returns:
      A modified copy of the this object
    • getValueInLocalDateTime

      @Lazy default LocalDateTime getValueInLocalDateTime()
      Returns the value (in LocalDateTime) that is assigned to this component, never null.

      Default: ZonedDateTime.now().

    • withValueInLocalDateTime

      default ICalendar withValueInLocalDateTime(LocalDateTime value)
      Returns a copy of this immutable component with the specified value.

      Assigns a value to this component.

      Parameters:
      value - The value of the calendar.

      Default: ZonedDateTime.now().

      Returns:
      A modified copy of the this object
    • getValueInLocalDate

      @Lazy default LocalDate getValueInLocalDate()
      Returns the value (in LocalDate) that is assigned to this component, never null.

      Default: ZonedDateTime.now().

    • withValueInLocalDate

      default ICalendar withValueInLocalDate(LocalDate value)
      Returns a copy of this immutable component with the specified value.

      Assigns a value to this component.

      Parameters:
      value - The value of the calendar.

      Default: ZonedDateTime.now().

      Returns:
      A modified copy of the this object
    • isWeekOfYear

      default boolean isWeekOfYear()
      Returns whether enable to show the week number within the current year or not.

      Default: false

    • withWeekOfYear

      ICalendar withWeekOfYear(boolean weekOfYear)
      Returns a copy of this immutable component with the specified weekOfYear.

      Sets whether enable to show the week number within the current year or not. [ZK EE]

      Parameters:
      weekOfYear - Whether enable to show the week number within the current year or not.

      Default: ZonedDateTime.now().

      Returns:
      A modified copy of the this object
    • getShowTodayLink

      default boolean getShowTodayLink()
      Returns whether enable to show the link that jump to today in day view

      Default: false

    • withShowTodayLink

      ICalendar withShowTodayLink(boolean showTodayLink)
      Returns a copy of this immutable component with the specified showTodayLink.

      Sets whether enable to show the link that jump to today in day view

      Parameters:
      showTodayLink - true to show a link to jump to today.

      Default: false.

      Returns:
      A modified copy of the this object
    • getTodayLinkLabel

      default String getTodayLinkLabel()
      Returns the label of the link that jump to today in day view

      Default: "Today"

    • withTodayLinkLabel

      ICalendar withTodayLinkLabel(String todayLinkLabel)
      Returns a copy of this immutable component with the specified todayLinkLabel.

      Sets the label of the link that jump to today in day view.

      Parameters:
      todayLinkLabel - The label of the link to jump to today.

      Default: "Today".

      Returns:
      A modified copy of the this object
    • of

      static ICalendar of(Date date)
      Return the instance of the given date.
      Parameters:
      date - The date to indicate the time for the calendar.
    • of

      static ICalendar of(Temporal date)
      Return the instance of the given date.
      Parameters:
      date - The date to indicate the time for the calendar.
    • ofConstraint

      static ICalendar ofConstraint(String constraint)
      Returns the instance with the given constraint.
      Parameters:
      constraint - The calendar constraint
    • ofId

      static ICalendar ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component