Interface ICalendar
- All Superinterfaces:
IAnyGroup<ICalendar>,IComponent<ICalendar>,IHtmlBasedComponent<ICalendar>,IXulElement<ICalendar>
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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeICalendar.static classBuilds an updater of typeICalendarforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns the client constraint to validate the value entered by a user. if any.getName()Returns the name of this component.default booleanReturns whether enable to show the link that jump to today in day viewdefault StringReturns the label of the link that jump to today in day viewdefault DategetValue()Returns the value that is assigned to this component, never null.default LocalDateReturns the value (in LocalDate) that is assigned to this component, never null.default LocalDateTimeReturns the value (in LocalDateTime) that is assigned to this component, never null.default ZonedDateTimeReturns the value (in ZonedDateTime) that is assigned to this component, never null.default StringReturns the client widget class.default booleanReturns whether enable to show the week number within the current year or not.static ICalendarReturn the instance of the given date.static ICalendarReturn the instance of the given date.static ICalendarofConstraint(String constraint) Returns the instance with the given constraint.static ICalendarReturns the instance with the given id.withConstraint(String constraint) Returns a copy ofthisimmutable component with the specifiedconstraint.Returns a copy ofthisimmutable component with the specifiedname.withShowTodayLink(boolean showTodayLink) Returns a copy ofthisimmutable component with the specifiedshowTodayLink.withTodayLinkLabel(String todayLinkLabel) Returns a copy ofthisimmutable component with the specifiedtodayLinkLabel.Returns a copy ofthisimmutable component with the specifiedvalue.default ICalendarwithValueInLocalDate(LocalDate value) Returns a copy ofthisimmutable component with the specifiedvalue.default ICalendarReturns a copy ofthisimmutable component with the specifiedvalue.default ICalendarReturns a copy ofthisimmutable component with the specifiedvalue.withWeekOfYear(boolean weekOfYear) Returns a copy ofthisimmutable component with the specifiedweekOfYear.Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverridesMethods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withSkeleton, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndexMethods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
Field Details
-
DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Details
-
getWidgetClass
Returns the client widget class.Default:
"zul.db.Calendar"- Specified by:
getWidgetClassin interfaceIComponent<ICalendar>
-
getConstraint
Returns the client constraint to validate the value entered by a user. if any.Default:
null -
withConstraint
Returns a copy ofthisimmutable component with the specifiedconstraint.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 asICalendar.ofConstraint("between 20211225 and 20211203");after yyyyMMdd Date only allowed after (and including) the specified date. The format must be yyyyMMdd, such asICalendar.ofConstraint("after 20211225");before yyyyMMdd Date only allowed before (and including) the specified date. The format must be yyyyMMdd, such asICalendar.ofConstraint("before 20211225");- Parameters:
constraint- The client constraint of the component.Default:
null.- Returns:
- A modified copy of the
thisobject
-
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
Returns a copy ofthisimmutable component with the specifiedname.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
thisobject
-
getValue
Returns the value that is assigned to this component, never null.Default:
ZonedDateTime.now() -
withValue
Returns a copy ofthisimmutable component with the specifiedvalue.Assigns a value to this component.
- Parameters:
value- The value of the calendar.Default:
ZonedDateTime.now().- Returns:
- A modified copy of the
thisobject
-
getValueInZonedDateTime
Returns the value (in ZonedDateTime) that is assigned to this component, never null.Default:
ZonedDateTime.now() -
withValueInZonedDateTime
Returns a copy ofthisimmutable component with the specifiedvalue.Assigns a value to this component.
- Parameters:
value- The value of the calendar.Default:
ZonedDateTime.now().- Returns:
- A modified copy of the
thisobject
-
getValueInLocalDateTime
Returns the value (in LocalDateTime) that is assigned to this component, never null.Default:
ZonedDateTime.now(). -
withValueInLocalDateTime
Returns a copy ofthisimmutable component with the specifiedvalue.Assigns a value to this component.
- Parameters:
value- The value of the calendar.Default:
ZonedDateTime.now().- Returns:
- A modified copy of the
thisobject
-
getValueInLocalDate
Returns the value (in LocalDate) that is assigned to this component, never null.Default:
ZonedDateTime.now(). -
withValueInLocalDate
Returns a copy ofthisimmutable component with the specifiedvalue.Assigns a value to this component.
- Parameters:
value- The value of the calendar.Default:
ZonedDateTime.now().- Returns:
- A modified copy of the
thisobject
-
isWeekOfYear
default boolean isWeekOfYear()Returns whether enable to show the week number within the current year or not.Default:
false -
withWeekOfYear
Returns a copy ofthisimmutable component with the specifiedweekOfYear.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
thisobject
-
getShowTodayLink
default boolean getShowTodayLink()Returns whether enable to show the link that jump to today in day viewDefault:
false -
withShowTodayLink
Returns a copy ofthisimmutable component with the specifiedshowTodayLink.Sets whether enable to show the link that jump to today in day view
- Parameters:
showTodayLink-trueto show a link to jump to today.Default:
false.- Returns:
- A modified copy of the
thisobject
-
getTodayLinkLabel
Returns the label of the link that jump to today in day viewDefault:
"Today" -
withTodayLinkLabel
Returns a copy ofthisimmutable component with the specifiedtodayLinkLabel.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
thisobject
-
of
Return the instance of the given date.- Parameters:
date- The date to indicate the time for the calendar.
-
of
Return the instance of the given date.- Parameters:
date- The date to indicate the time for the calendar.
-
ofConstraint
Returns the instance with the given constraint.- Parameters:
constraint- The calendar constraint
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-