Package org.zkoss.zul

Class Calendar

All Implemented Interfaces:
Serializable, Cloneable, Component, Scope, ComponentCtrl, Constrainted

public class Calendar extends XulElement implements Constrainted
A calendar.

Default getZclass(): z-calendar. (since 3.5.0)

Support display the week number within the current year

Events: onWeekClick

For example


 <calendar weekOfYear="true" onWeekClick='alert(event.data)'/>
 
[ZK EE] [Since 6.5.0]
Author:
tomyeh
See Also:
  • Constructor Details

    • Calendar

      public Calendar()
    • Calendar

      public Calendar(Date value)
    • Calendar

      public Calendar(ZonedDateTime value)
    • Calendar

      public Calendar(LocalDateTime value)
    • Calendar

      public Calendar(LocalDate value)
  • Method Details

    • setWeekOfYear

      public void setWeekOfYear(boolean weekOfYear)
      Sets whether enable to show the week number within the current year or not. [ZK EE]
      Since:
      6.5.0
    • isWeekOfYear

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

      Default: false

      Since:
      6.5.0
    • getValue

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

      public void setValue(Date value)
      Assigns a value to this component.
      Parameters:
      value - the date to assign. If null, today is assumed.
    • getValueInZonedDateTime

      public ZonedDateTime getValueInZonedDateTime()
      Returns the value (in ZonedDateTime) that is assigned to this component, never null.
      Since:
      9.0.0
    • setValueInZonedDateTime

      public void setValueInZonedDateTime(ZonedDateTime value)
      Assigns a value (in ZonedDateTime) to this component.
      Parameters:
      value - the date to assign. If null, today is assumed.
      Since:
      9.0.0
    • getValueInLocalDateTime

      public LocalDateTime getValueInLocalDateTime()
      Returns the value (in LocalDateTime) that is assigned to this component, never null.
      Since:
      9.0.0
    • setValueInLocalDateTime

      public void setValueInLocalDateTime(LocalDateTime value)
      Assigns a value (in LocalDateTime) to this component.
      Parameters:
      value - the date to assign. If null, today is assumed.
      Since:
      9.0.0
    • getValueInLocalDate

      public LocalDate getValueInLocalDate()
      Returns the value (in LocalDate) that is assigned to this component, never null.
      Since:
      9.0.0
    • setValueInLocalDate

      public void setValueInLocalDate(LocalDate value)
      Assigns a value (in LocalDate) to this component.
      Parameters:
      value - the date to assign. If null, today is assumed.
      Since:
      9.0.0
    • getValueInLocalTime

      public LocalTime getValueInLocalTime()
      Returns the value (in LocalTime) that is assigned to this component, never null.
      Since:
      9.0.0
    • setValueInLocalTime

      public void setValueInLocalTime(LocalTime value) throws WrongValueException
      It is meaningless to set only LocalTime in calendar.
      Throws:
      WrongValueException
      Since:
      9.0.0
    • getName

      public 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.

      Since:
      3.0.0
    • setName

      public void setName(String 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.
      Since:
      3.0.0
    • getShowTodayLink

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

      Default: false

      Returns:
      boolean
      Since:
      8.0.0
    • setShowTodayLink

      public void setShowTodayLink(boolean showTodayLink)
      Sets whether enable to show the link that jump to today in day view
      Parameters:
      showTodayLink - show or hidden
      Since:
      8.0.0
    • getTodayLinkLabel

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

      Default: Today

      Returns:
      String
      Since:
      8.0.4
    • setTodayLinkLabel

      public void setTodayLinkLabel(String todayLinkLabel)
      Sets the label of the link that jump to today in day view
      Parameters:
      todayLinkLabel - today link label
      Since:
      8.0.4
    • setConstraint

      public void setConstraint(String constr)
      Sets a list of constraints separated by comma. Example: "between 20071012 and 20071223", "before 20080103".
      Parameters:
      constr - a list of constraints separated by comma.
    • setConstraint

      public void setConstraint(Constraint constr)
      Description copied from interface: Constrainted
      Sets the constraint.

      Default: null (means no constraint all all).

      Specified by:
      setConstraint in interface Constrainted
    • getConstraint

      public Constraint getConstraint()
      Description copied from interface: Constrainted
      Returns the constraint, or null if no constraint at all.
      Specified by:
      getConstraint in interface Constrainted
    • getZclass

      public String getZclass()
      Description copied from class: HtmlBasedComponent
      Returns the ZK Cascading Style class for this component. It usually depends on the implementation of the mold (AbstractComponent.getMold()).

      Default: null (the default value depends on element).

      HtmlBasedComponent.setZclass(java.lang.String)) will completely replace the default style of a component. In other words, the default style of a component is associated with the default value of HtmlBasedComponent.getZclass(). Once it is changed, the default style won't be applied at all. If you want to perform small adjustments, use HtmlBasedComponent.setSclass(java.lang.String) instead.

      Overrides:
      getZclass in class HtmlBasedComponent
      See Also:
    • service

      public void service(AuRequest request, boolean everError)
      Processes an AU request.

      Default: in addition to what are handled by HtmlBasedComponent.service(org.zkoss.zk.au.AuRequest, boolean), it also handles onChange, onChanging and onError.

      Specified by:
      service in interface ComponentCtrl
      Overrides:
      service in class HtmlBasedComponent
      everError - whether any error ever occurred before processing this request.
      Since:
      5.0.0
      See Also:
    • renderProperties

      protected void renderProperties(ContentRenderer renderer) throws IOException
      Description copied from class: HtmlBasedComponent
      Renders the content of this component, excluding the enclosing tags and children.

      See also ZK Client-side Reference: Property Rendering

      Overrides:
      renderProperties in class XulElement
      Throws:
      IOException