Interface IDaterangebox
- All Superinterfaces:
IAnyGroup<IDaterangebox>,IComponent<IDaterangebox>,IDisable<IDaterangebox>,IHtmlBasedComponent<IDaterangebox>,IReadonly<IDaterangebox>,IXulElement<IDaterangebox>
Daterangebox component (ZK EE only).
A date range picker. Allows users to select a contiguous range of dates (optionally including time) via a popup with one or more side-by-side calendar panels and an optional minimum / maximum length constraint.
The range is carried by a single value of type
DateRange; beginValue and
endValue are derived views of its two endpoints.
Either end may be null when
allowEmpty permits.
Support @Action
| Name | Action Type |
|---|---|
| onChange | ActionData: DateRangeData
Denotes the committed range has been changed by the user. |
| onChanging | ActionData: DateRangeData
Denotes the user is typing into one of the two inputs; the range is not committed yet. |
| onOpen | ActionData: OpenData
Denotes the calendar popup has been opened or closed. |
| onError | ActionData: ErrorData
Denotes the user entered a value that cannot be parsed. |
Constraint
The constraint is a
SimpleDateConstraint expression applied to both endpoints,
for example
IDaterangebox.ofConstraint("between 20240101 and 20241231");
IDaterangebox.ofConstraint("no past");
Only the string form is supported, the same way
IInputElement.withConstraint(String) and
ICalendar.withConstraint(String) are — a server-side
Constraint instance has no place in an immutable component.
Length Option
withMinNights(int) and withMaxNights(int) bound the
number of nights between the two endpoints; 0 disables the bound.
Position
By default, the popup position is set to after_start, for other
possible popup positions please refer to IPopupBase.Position.
- Since:
- 11.0.0
- Author:
- peaker
- See Also:
-
Daterangebox
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeIDaterangebox.static classBuilds an updater of typeIDaterangeboxforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IDaterangeboxConstant for default attributes of this immutable component. -
Method Summary
Modifier and TypeMethodDescriptiondefault StringReturns which endpoints may be left empty: one of"none","begin","end"or"both".Returns the placeholder for the begin input, ornullif none.default DateReturns the begin endpoint, ornullif unset.Returns theSimpleDateConstraintexpression applied to both endpoints, ornullif none.Returns the placeholder for the end input, ornullif none.default DateReturns the end endpoint, ornullif unset.Returns the raw date format pattern, ornullif none was set (in which casegetRealFormat()supplies the locale-derived fallback).Returns the additional attributes which is set bywithInputAttributes(Map)Returns the locale used for month/weekday labels and the first-day-of-week, ornull(the page/current locale) if unset.default intReturns the maximum number of nights allowed between begin and end.default intReturns the minimum number of nights required between begin and end.default intReturns the number of side-by-side calendar panels shown in the popup.Returns the placeholder applied to both inputs when no per-input placeholder is set, ornullif none.default StringReturns the popup anchor position token.default StringReturns the separator rendered between the two date inputs.Returns the time zone used for calendar-day boundary decisions and constraint-bound parsing, ornull(the current time zone) if unset.default StringReturns the label of the "Today" shortcut shown in the popup footer.org.zkoss.zul.DateRangegetValue()Returns the current range, ornullif unset.default StringReturns the client widget class.default booleanReturns whether the calendar drop-down button is shown to the right of the inputs.default booleanReturns whether hovering a candidate end date previews the range in the calendar.default booleanReturns whether date parsing is lenient.default BooleanReturns whether the popup shows a time picker and the inputs display the time component, ornullwhen it was never set.default booleanReturns whether the "Today" shortcut link is shown in the day view.default booleanReturns whether strict date validation is enabled, rejecting impossible dates such as"Nov 31".default booleanReturns whether the week-of-year column is shown in the calendar panels.static IDaterangeboxReturns the instance with the given endpoints.static IDaterangeboxof(org.zkoss.zul.DateRange value) Returns the instance with the given range.static IDaterangeboxofConstraint(String constraint) Returns the instance with the given constraint.static IDaterangeboxReturns the instance with the given format.static IDaterangeboxReturns the instance with the given id.withAllowEmpty(String allowEmpty) Returns a copy ofthisimmutable component with the specifiedallowEmpty.withBeginPlaceholder(String beginPlaceholder) Returns a copy ofthisimmutable component with the specifiedbeginPlaceholder.default IDaterangeboxwithBeginValue(Date beginValue) Returns a copy ofthisimmutable component with the specifiedbeginValue, keeping the current end endpoint.default IDaterangeboxwithBeginValueInLocalDate(LocalDate beginValue) Returns a copy ofthisimmutable component with the specifiedbeginValuetaken at start of day ingetTimeZone().default IDaterangeboxwithBeginValueInLocalDateTime(LocalDateTime beginValue) Returns a copy ofthisimmutable component with the specifiedbeginValue, interpreted ingetTimeZone().default IDaterangeboxwithBeginValueInZonedDateTime(ZonedDateTime beginValue) Returns a copy ofthisimmutable component with the specifiedbeginValue(its instant is used).withButtonVisible(boolean buttonVisible) Returns a copy ofthisimmutable component with the specifiedbuttonVisible.withConstraint(String constraint) Returns a copy ofthisimmutable component with the specifiedconstraint.withEndPlaceholder(String endPlaceholder) Returns a copy ofthisimmutable component with the specifiedendPlaceholder.default IDaterangeboxwithEndValue(Date endValue) Returns a copy ofthisimmutable component with the specifiedendValue, keeping the current begin endpoint.default IDaterangeboxwithEndValueInLocalDate(LocalDate endValue) Returns a copy ofthisimmutable component with the specifiedendValuetaken at start of day ingetTimeZone().default IDaterangeboxwithEndValueInLocalDateTime(LocalDateTime endValue) Returns a copy ofthisimmutable component with the specifiedendValue, interpreted ingetTimeZone().default IDaterangeboxwithEndValueInZonedDateTime(ZonedDateTime endValue) Returns a copy ofthisimmutable component with the specifiedendValue(its instant is used).withFormat(String format) Returns a copy ofthisimmutable component with the specifiedformat.withHoverPreview(boolean hoverPreview) Returns a copy ofthisimmutable component with the specifiedhoverPreview.withInputAttributes(Map<String, ? extends String> inputAttributes) Returns a copy ofthisimmutable component with the specifiedinputAttributes.withLenient(boolean lenient) Returns a copy ofthisimmutable component with the specifiedlenient.default IDaterangeboxwithLocale(String locale) Returns a copy ofthisimmutable component with the specifiedlocale.withLocale(Locale locale) Returns a copy ofthisimmutable component with the specifiedlocale.withMaxNights(int maxNights) Returns a copy ofthisimmutable component with the specifiedmaxNights.withMinNights(int minNights) Returns a copy ofthisimmutable component with the specifiedminNights.withNumberOfMonths(int numberOfMonths) Returns a copy ofthisimmutable component with the specifiednumberOfMonths.withPlaceholder(String placeholder) Returns a copy ofthisimmutable component with the specifiedplaceholder.withPosition(String position) Returns a copy ofthisimmutable component with the specifiedposition.default IDaterangeboxwithPosition(IPopupBase.Position position) Returns a copy ofthisimmutable component with the specifiedposition.withSeparator(String separator) Returns a copy ofthisimmutable component with the specifiedseparator.withShowTime(Boolean showTime) Returns a copy ofthisimmutable component with the specifiedshowTime.withShowTodayLink(boolean showTodayLink) Returns a copy ofthisimmutable component with the specifiedshowTodayLink.withStrictDate(boolean strictDate) Returns a copy ofthisimmutable component with the specifiedstrictDate.default IDaterangeboxwithTimeZone(String timeZone) Returns a copy ofthisimmutable component with the specifiedtimeZone.withTimeZone(TimeZone timeZone) Returns a copy ofthisimmutable component with the specifiedtimeZone.withTodayLinkLabel(String todayLinkLabel) Returns a copy ofthisimmutable component with the specifiedtodayLinkLabel.withValue(org.zkoss.zul.DateRange value) Returns a copy ofthisimmutable component with the specifiedvalue.default IDaterangeboxwithValueInLocalDate(org.zkoss.zul.LocalDateRange value) Returns a copy ofthisimmutable component with the specifiedvalue, each end taken at start of day ingetTimeZone().default IDaterangeboxwithValueInLocalDateTime(org.zkoss.zul.LocalDateTimeRange value) Returns a copy ofthisimmutable component with the specifiedvalue, each end interpreted ingetTimeZone().default IDaterangeboxwithValueInZonedDateTime(org.zkoss.zul.ZonedDateTimeRange value) Returns a copy ofthisimmutable component with the specifiedvalue(each end's instant is used).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.IDisable
isDisabled, withDisabledMethods 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.IReadonly
isReadonly, withReadonlyMethods 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:
"zkmax.db.Daterangebox"- Specified by:
getWidgetClassin interfaceIComponent<IDaterangebox>
-
getValue
@Nullable org.zkoss.zul.DateRange getValue()Returns the current range, ornullif unset. Either end of a non-null range may itself benull(an open-ended range).This is the one stored endpoint attribute;
getBeginValue()andgetEndValue()are derived from it.DateRangecopies both ends on the way in and on the way out, so a caller that keeps a reference to theDateit passed cannot mutate this component afterwards.Default:
null -
withValue
Returns a copy ofthisimmutable component with the specifiedvalue.Sets both endpoints at once.
Note:
UiAgent.smartUpdate(Locator, SmartUpdater)is not supported for this property —IDaterangebox.Updaterships the raw attribute while the initial render ships the epoch millis the client widget parses. Push a whole component withUiAgent.replaceWith(Locator, IComponent)instead.- Parameters:
value- The range;nullclears both ends.- Returns:
- A modified copy of the
thisobject
-
getBeginValue
Returns the begin endpoint, ornullif unset.A derived snapshot of
getValue(); mutating the returnedDateis not supported, callgetValue()for a fresh copy.Default:
null -
withBeginValue
Returns a copy ofthisimmutable component with the specifiedbeginValue, keeping the current end endpoint.Sets the begin endpoint. See
withValue(DateRange)for thesmartUpdaterestriction.- Parameters:
beginValue- The begin date;nullclears the begin endpoint.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getEndValue
Returns the end endpoint, ornullif unset.A derived snapshot of
getValue(); mutating the returnedDateis not supported, callgetValue()for a fresh copy.Default:
null -
withEndValue
Returns a copy ofthisimmutable component with the specifiedendValue, keeping the current begin endpoint.Sets the end endpoint. See
withValue(DateRange)for thesmartUpdaterestriction.- Parameters:
endValue- The end date;nullclears the end endpoint.Default:
null.- Returns:
- A modified copy of the
thisobject
-
withBeginValueInLocalDate
Returns a copy ofthisimmutable component with the specifiedbeginValuetaken at start of day ingetTimeZone().- Parameters:
beginValue- The begin date;nullclears the begin endpoint.- Returns:
- A modified copy of the
thisobject
-
withEndValueInLocalDate
Returns a copy ofthisimmutable component with the specifiedendValuetaken at start of day ingetTimeZone().- Parameters:
endValue- The end date;nullclears the end endpoint.- Returns:
- A modified copy of the
thisobject
-
withValueInLocalDate
Returns a copy ofthisimmutable component with the specifiedvalue, each end taken at start of day ingetTimeZone().- Parameters:
value- The range;nullclears both ends.- Returns:
- A modified copy of the
thisobject
-
withBeginValueInLocalDateTime
Returns a copy ofthisimmutable component with the specifiedbeginValue, interpreted ingetTimeZone().- Parameters:
beginValue- The begin date-time;nullclears the begin endpoint.- Returns:
- A modified copy of the
thisobject
-
withEndValueInLocalDateTime
Returns a copy ofthisimmutable component with the specifiedendValue, interpreted ingetTimeZone().- Parameters:
endValue- The end date-time;nullclears the end endpoint.- Returns:
- A modified copy of the
thisobject
-
withValueInLocalDateTime
Returns a copy ofthisimmutable component with the specifiedvalue, each end interpreted ingetTimeZone().- Parameters:
value- The range;nullclears both ends.- Returns:
- A modified copy of the
thisobject
-
withBeginValueInZonedDateTime
Returns a copy ofthisimmutable component with the specifiedbeginValue(its instant is used).- Parameters:
beginValue- The begin date-time;nullclears the begin endpoint.- Returns:
- A modified copy of the
thisobject
-
withEndValueInZonedDateTime
Returns a copy ofthisimmutable component with the specifiedendValue(its instant is used).- Parameters:
endValue- The end date-time;nullclears the end endpoint.- Returns:
- A modified copy of the
thisobject
-
withValueInZonedDateTime
Returns a copy ofthisimmutable component with the specifiedvalue(each end's instant is used).- Parameters:
value- The range;nullclears both ends.- Returns:
- A modified copy of the
thisobject
-
getFormat
Returns the raw date format pattern, ornullif none was set (in which casegetRealFormat()supplies the locale-derived fallback).Default:
null -
withFormat
Returns a copy ofthisimmutable component with the specifiedformat.Sets the date format pattern applied to both input fields, using
java.text.SimpleDateFormatletters (e.g.yyyy/MM/dd).nullor""resets to the locale-aware MEDIUM fallback.Note:
UiAgent.smartUpdate(Locator, SmartUpdater)is not supported for this property —IDaterangebox.Updaterships the raw attribute while the initial render shipsgetRealFormat(). Push a whole component withUiAgent.replaceWith(Locator, IComponent)instead.- Parameters:
format- The format pattern, ornull/""for the default.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getLocale
Returns the locale used for month/weekday labels and the first-day-of-week, ornull(the page/current locale) if unset.Default:
null -
withLocale
Returns a copy ofthisimmutable component with the specifiedlocale.Sets the locale used for month/weekday labels and the first-day-of-week.
Note:
UiAgent.smartUpdate(Locator, SmartUpdater)is not supported for this property —IDaterangebox.Updaterships the raw attribute while the initial render shipslocale.toString()plus the localized symbols. Push a whole component withUiAgent.replaceWith(Locator, IComponent)instead.- Parameters:
locale- The preferred locale, ornullto use the current locale.Default:
null.- Returns:
- A modified copy of the
thisobject
-
withLocale
Returns a copy ofthisimmutable component with the specifiedlocale.Sets the locale from its string code (e.g.
"zh_TW").- Parameters:
locale- The locale code, ornull/""to clear.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getTimeZone
Returns the time zone used for calendar-day boundary decisions and constraint-bound parsing, ornull(the current time zone) if unset.Default:
null -
withTimeZone
Returns a copy ofthisimmutable component with the specifiedtimeZone.Sets the time zone used for calendar-day boundary decisions and for
SimpleDateConstraintbound parsing.Note:
UiAgent.smartUpdate(Locator, SmartUpdater)is not supported for this property —IDaterangebox.Updaterships the raw attribute while the initial render shipsDateTimeFormatInputElement.getFormattedTimeZone(timeZone). Push a whole component withUiAgent.replaceWith(Locator, IComponent)instead.- Parameters:
timeZone- The preferred time zone, ornullto use the current one.Default:
null.- Returns:
- A modified copy of the
thisobject
-
withTimeZone
Returns a copy ofthisimmutable component with the specifiedtimeZone.Sets the time zone from its ID (e.g.
"Asia/Tokyo").- Parameters:
timeZone- The time zone ID, ornull/""to clear.Default:
null.- Returns:
- A modified copy of the
thisobject - Throws:
org.zkoss.zk.ui.WrongValueException- iftimeZoneis not a recognized time zone ID.
-
getConstraint
Returns theSimpleDateConstraintexpression applied to both endpoints, ornullif none.Default:
null -
withConstraint
Returns a copy ofthisimmutable component with the specifiedconstraint.Sets the constraint from a
SimpleDateConstraintexpression (e.g."between 20240101 and 20241231","no past"), which is applied to both the begin and end values.- Parameters:
constraint- The constraint expression, ornullto clear.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getNumberOfMonths
default int getNumberOfMonths()Returns the number of side-by-side calendar panels shown in the popup.Default: the library property
org.zkoss.zul.daterangebox.numberOfMonths(2if unset). -
withNumberOfMonths
Returns a copy ofthisimmutable component with the specifiednumberOfMonths.Sets the number of side-by-side calendar panels shown in the popup.
- Parameters:
numberOfMonths- The panel count; must be between1and the configured maximum (library propertyorg.zkoss.zul.daterangebox.numberOfMonths.max, default12).- Returns:
- A modified copy of the
thisobject - Throws:
org.zkoss.zk.ui.WrongValueException- if it is outside that range.
-
getAllowEmpty
Returns which endpoints may be left empty: one of"none","begin","end"or"both".Default:
"both" -
withAllowEmpty
Returns a copy ofthisimmutable component with the specifiedallowEmpty.Sets which endpoints may be left empty.
- Parameters:
allowEmpty- one ofnone,begin,endorboth.Default:
"both".- Returns:
- A modified copy of the
thisobject - Throws:
org.zkoss.zk.ui.WrongValueException- if it is not one of the accepted tokens.
-
isShowTime
Returns whether the popup shows a time picker and the inputs display the time component, ornullwhen it was never set.Default:
null(unset)Tri-state, mirroring
Daterangebox'sBoolean _showTime:nullleaves the decision to the client, which auto-detects a time token in the format; an explicitfalsesuppresses that auto-detection. Only a non-null value reaches the wire, so the three states stay distinguishable. -
withShowTime
Returns a copy ofthisimmutable component with the specifiedshowTime.Sets whether the popup shows a time picker. When turned on without an explicit format,
" HH:mm"is appended to the effective format (seegetRealFormat()).- Parameters:
showTime-trueto show the time picker,falseto suppress it even for a time-bearing format, ornullto let the client decide from the format.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getMinNights
default int getMinNights()Returns the minimum number of nights required between begin and end.0means no minimum.Default:
0 -
withMinNights
Returns a copy ofthisimmutable component with the specifiedminNights.Sets the minimum number of nights required between begin and end.
- Parameters:
minNights- The minimum nights; must be>= 0and not exceed a non-zerogetMaxNights().Default:
0.- Returns:
- A modified copy of the
thisobject - Throws:
org.zkoss.zk.ui.WrongValueException- if it is negative, or greater than a configured non-zeromaxNights.
-
getMaxNights
default int getMaxNights()Returns the maximum number of nights allowed between begin and end.0means unbounded.Default:
0 -
withMaxNights
Returns a copy ofthisimmutable component with the specifiedmaxNights.Sets the maximum number of nights allowed between begin and end.
- Parameters:
maxNights- The maximum nights; must be>= 0and not less than a non-zerogetMinNights().Default:
0.- Returns:
- A modified copy of the
thisobject - Throws:
org.zkoss.zk.ui.WrongValueException- if it is negative, or less than a configured non-zerominNights.
-
getPosition
Returns the popup anchor position token.Default:
"after_start" -
withPosition
Returns a copy ofthisimmutable component with the specifiedposition.Position the calendar popup to the specified location.
- Parameters:
position- Where to position. Default:after_start. It accepts the same tokens asIPopupBase.Position.- Returns:
- A modified copy of the
thisobject
-
withPosition
Returns a copy ofthisimmutable component with the specifiedposition.Position the calendar popup to the specified location.
- Parameters:
position- Where to position. Default:IPopupBase.Position.AFTER_START- Returns:
- A modified copy of the
thisobject
-
isButtonVisible
default boolean isButtonVisible()Returns whether the calendar drop-down button is shown to the right of the inputs.Default:
true -
withButtonVisible
Returns a copy ofthisimmutable component with the specifiedbuttonVisible.Sets whether the calendar drop-down button is shown.
- Parameters:
buttonVisible-falseto hide the button.Default:
true.- Returns:
- A modified copy of the
thisobject
-
isWeekOfYear
default boolean isWeekOfYear()Returns whether the week-of-year column is shown in the calendar panels.Default:
false -
withWeekOfYear
Returns a copy ofthisimmutable component with the specifiedweekOfYear.Sets whether the week-of-year column is shown in the calendar panels.
- Parameters:
weekOfYear-trueto show the week-of-year column.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isShowTodayLink
default boolean isShowTodayLink()Returns whether the "Today" shortcut link is shown in the day view.Default:
false -
withShowTodayLink
Returns a copy ofthisimmutable component with the specifiedshowTodayLink.Sets whether the "Today" shortcut link is shown in the day view.
- Parameters:
showTodayLink-trueto show the "Today" link.Default:
false.- Returns:
- A modified copy of the
thisobject
-
getTodayLinkLabel
Returns the label of the "Today" shortcut shown in the popup footer.Default: the localized
MZul.CALENDAR_TODAY("Today" in English) -
withTodayLinkLabel
Returns a copy ofthisimmutable component with the specifiedtodayLinkLabel.Sets the label of the "Today" shortcut shown in the popup footer.
- Parameters:
todayLinkLabel- The label of the link to jump to today, ornull—Daterangebox.setTodayLinkLabel(String)accepts a null and the C2I conversion has to be able to carry it back.Default:
"Today".- Returns:
- A modified copy of the
thisobject
-
getInputAttributes
Returns the additional attributes which is set bywithInputAttributes(Map)Default:
null. -
withInputAttributes
Returns a copy ofthisimmutable component with the specifiedinputAttributes.Sets some additional attributes to both range inputs at client. It is also how to specify the HTML
autocompleteattribute required by WCAG 1.3.5 (Identify Input Purpose) when this component collects information about the user, for exampleautocomplete=bday.- Parameters:
inputAttributes- A Map with attribute names as the keys.Default:
null.- Returns:
- A modified copy of the
thisobject
-
isLenient
default boolean isLenient()Returns whether date parsing is lenient. With lenient parsing, inputs that do not exactly match the format may be interpreted heuristically.Default:
true -
withLenient
Returns a copy ofthisimmutable component with the specifiedlenient.Sets whether date parsing is lenient.
- Parameters:
lenient-falseto require inputs to match the format exactly.Default:
true.- Returns:
- A modified copy of the
thisobject
-
isStrictDate
default boolean isStrictDate()Returns whether strict date validation is enabled, rejecting impossible dates such as"Nov 31".Default:
false -
withStrictDate
Returns a copy ofthisimmutable component with the specifiedstrictDate.Sets whether strict date validation is enabled.
- Parameters:
strictDate-trueto refuse dates like"Jan 0".Default:
false.- Returns:
- A modified copy of the
thisobject
-
getSeparator
Returns the separator rendered between the two date inputs.Default: the library property
org.zkoss.zul.daterangebox.separator("~"if unset) -
withSeparator
Returns a copy ofthisimmutable component with the specifiedseparator.Sets the separator string rendered between the two date inputs.
Note: unlike
Daterangebox.setSeparator(String),nullis not accepted here. To fall back togetSeparator()'s default chain, build a fresh instance without setting a separator.- Parameters:
separator- The separator string.Default:
"~".- Returns:
- A modified copy of the
thisobject
-
getPlaceholder
Returns the placeholder applied to both inputs when no per-input placeholder is set, ornullif none.Default:
null -
withPlaceholder
Returns a copy ofthisimmutable component with the specifiedplaceholder.Sets the placeholder shown in both inputs when empty.
- Parameters:
placeholder- The placeholder text, ornullto clear.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getBeginPlaceholder
Returns the placeholder for the begin input, ornullif none.Default:
null -
withBeginPlaceholder
Returns a copy ofthisimmutable component with the specifiedbeginPlaceholder.Sets the placeholder shown in the begin input when empty.
- Parameters:
beginPlaceholder- The placeholder text, ornullto clear.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getEndPlaceholder
Returns the placeholder for the end input, ornullif none.Default:
null -
withEndPlaceholder
Returns a copy ofthisimmutable component with the specifiedendPlaceholder.Sets the placeholder shown in the end input when empty.
- Parameters:
endPlaceholder- The placeholder text, ornullto clear.Default:
null.- Returns:
- A modified copy of the
thisobject
-
isHoverPreview
default boolean isHoverPreview()Returns whether hovering a candidate end date previews the range in the calendar.Default: the library property
org.zkoss.zul.daterangebox.hoverPreview(trueif unset) -
withHoverPreview
Returns a copy ofthisimmutable component with the specifiedhoverPreview.Sets whether hovering a candidate end date previews the range.
- Parameters:
hoverPreview-falseto disable the hover preview.Default:
true.- Returns:
- A modified copy of the
thisobject
-
of
Returns the instance with the given range.- Parameters:
value- The initial range
-
of
Returns the instance with the given endpoints.- Parameters:
beginValue- The begin date, ornullendValue- The end date, ornull
-
ofFormat
Returns the instance with the given format.- Parameters:
format- The daterangebox format
-
ofConstraint
Returns the instance with the given constraint.- Parameters:
constraint- The daterangebox constraint
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-