WebRADDocumentationExplore WebRAD ↗
WEBRAD / TECHNICAL REFERENCE

Date

Local date or date and time input with a calendar, display mask, and validation.

WebDateStandardVisual6 events

Quick start

Add Date1 in the Designer. Use the example in a page method.

Date1 · event
Date1.mode = 'date';
Date1.dateFormat = 'dd/MM/yyyy';
Date1.required = true;
Date1.min = '2026-01-01';
Date1.max = '2026-12-31';
Date1.value = '2026-11-04';
Date1.onChange = (sender) => {
  if (sender.valid) console.log(sender.value, sender.text);
};

Configure a date field

  1. Add Date from the palette and select it in the Designer.
  2. In the Inspector, choose Mode: date or datetime. Set Date format to dd/MM/yyyy, MM/dd/yyyy, or yyyy-MM-dd; enable Show seconds for datetime when needed.
  3. Set the accessible label, optional placeholder, required and read-only settings, and whether to show the calendar. Configure value, min, and max using local ISO values; the limits are inclusive.
  4. Link OnInput for typing and OnChange for a committed change in Interaction. The calendar can also be opened with Alt+Down or showPicker().

Values and validation

The displayed mask follows the selected format and mode. value uses YYYY-MM-DD or local YYYY-MM-DDTHH:mm[:ss], independent of the display format. These are local calendar fields with no time zone or UTC conversion. text contains the displayed draft, including incomplete or impossible dates; value is empty for such drafts. date returns a local Date at the start of the day, while datetime includes the time; both return null for invalid or incomplete input.

Use valid or checkValidity() before processing input and reportValidity() to show the browser's validation message. required, min, and max participate in validation. clear() clears the field and setNow() uses the current local date and time. Runtime assignments affect the current instance; configure the Inspector to save project defaults.

More examples

Date and time with validation
Date and time with validation
Date1.mode = 'datetime';
Date1.dateFormat = 'MM/dd/yyyy';
Date1.showSeconds = true;
Date1.min = '2026-01-01T09:00:00';
Date1.max = '2026-12-31T18:00:00';
Date1.value = '2026-11-04T14:30:00';
if (Date1.reportValidity()) {
  console.log(Date1.value, Date1.text, Date1.datetime);
}
Calendar and current date
Calendar and current date
Date1.mode = 'date';
Date1.setNow();
if (!Date1.showPicker()) console.log('Calendar is unavailable');
// Date1.clear();

Inspector properties

Component options and defaults. Fields without runtime access are configured in the Inspector.

Property / sourceType and optionsDefaultRuntime access
nameName · Identitystring—name
xLeft · Size & positionnumber0x
yTop · Size & positionnumber0y
widthWidth · Size & positionnumber240width
heightHeight · Size & positionnumber36height
itemWidthResponsive width · Responsive sizeFit content grows the item to its widest rendered child and preserves child intrinsic widths; minimum and maximum width remain limits.enumfixed stretch fit-content"fixed"Inspector / configuration
itemHeightResponsive height · Responsive sizeFit content grows the item to its lowest rendered child and preserves child intrinsic heights; minimum and maximum height remain limits.enumfixed stretch fit-content"fixed"Inspector / configuration
itemMinWidthMinimum width · Responsive sizenumber0Inspector / configuration
itemMaxWidthMaximum width · Responsive sizenumbernullInspector / configuration
itemMinHeightMinimum height · Responsive sizenumber0Inspector / configuration
itemMaxHeightMaximum height · Responsive sizenumbernullInspector / configuration
itemGrowGrow · Responsive sizenumber0Inspector / configuration
itemShrinkShrink · Responsive sizeAllows fixed and stretch flow items to yield space. Fit-content keeps its intrinsic size so its children are not compressed.booleantrueInspector / configuration
itemAlignSelfItem alignment · Responsive sizeCross-axis alignment for this item in a row or column. Auto inherits the parent alignment; responsive cross-axis stretch retains its sizing behavior.enumauto start center end stretch"auto"Inspector / configuration
itemHorizontalAnchorHorizontal anchor · Anchors & offsetsenumstart center end stretch"start"Inspector / configuration
itemVerticalAnchorVertical anchor · Anchors & offsetsenumstart center end stretch"start"Inspector / configuration
itemLeftLeft inset · Anchors & offsetsnumber0Inspector / configuration
itemRightRight inset · Anchors & offsetsnumber0Inspector / configuration
itemTopTop inset · Anchors & offsetsnumber0Inspector / configuration
itemBottomBottom inset · Anchors & offsetsnumber0Inspector / configuration
marginMargin · SpacingOuter spacing on all four sides, in pixels. Row and column layouts include this spacing between components.number0margin
marginTopMargin top · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginTop
marginRightMargin right · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginRight
marginBottomMargin bottom · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginBottom
marginLeftMargin left · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginLeft
visibleVisible · Behaviorbooleantruevisible
collapseWhenHiddenCollapse when hidden · BehaviorRemoves the component from the layout while it is not visible.booleantruecollapseWhenHidden
enabledEnabled · Behaviorbooleantrueenabled
tabIndexTabIndex · Behaviornumber0tabIndex
modeMode · Date & timeDate only, or a local date and time without automatic UTC conversion.enumdate datetime"date"mode
dateFormatDate format · Date & timeDisplay and typing mask. The canonical value always uses ISO calendar fields.enumdd/MM/yyyy MM/dd/yyyy yyyy-MM-dd"dd/MM/yyyy"dateFormat
showSecondsShow seconds · Date & timebooleanfalseshowSecondsConditional availability in the Inspector
valueValue · DataEmpty, YYYY-MM-DD, or local YYYY-MM-DDTHH:mm[:ss]. The display uses the selected mask.string""value
minMinimum · ValidationInclusive lower limit in local ISO format; empty removes the limit.string""min
maxMaximum · ValidationInclusive upper limit in local ISO format; empty removes the limit.string""max
requiredRequired · Validationbooleanfalserequired
readOnlyRead Only · BehaviorbooleanfalsereadOnly
showCalendarShow calendar · AppearancebooleantrueshowCalendar
placeholderPlaceholder · AppearanceEmpty displays the selected mask.string""placeholder
accessibleLabelAccessible label · AccessibilityEmpty uses the component name.string""accessibleLabel
currentRowBindingsCurrent row · DataBind writable visual values to fields of this repeated row.current-row-bindingsEditor: current-row-bindings[]currentRowBindings

API in code

MemberSignatureAccess
modeget mode(): WebDateMode;Read and write
dateFormatget dateFormat(): WebDateFormat;Read and write
showSecondsget showSeconds(): boolean;Read and write
maskget mask(): string;Read-only
valueCanonical YYYY-MM-DD or YYYY-MM-DDTHH:mm[:ss]; empty while incomplete/invalid.get value(): string;Read and write
textDisplay text, including an incomplete or invalid draft.get text(): string;Read and write
dateA fresh Date at the start of the local day; null for an empty/incomplete/impossible date.get date(): Date | null;Read and write
datetimeA fresh local Date including time; date mode returns the start of the local day.get datetime(): Date | null;Read and write
minget min(): string;Read and write
maxget max(): string;Read and write
requiredget required(): boolean;Read and write
readOnlyget readOnly(): boolean;Read and write
placeholderget placeholder(): string;Read and write
accessibleLabelget accessibleLabel(): string;Read and write
showCalendarget showCalendar(): boolean;Read and write
visibleget visible(): boolean;Read and write
enabledget enabled(): boolean;Read and write
tabIndexget tabIndex(): number;Read and write
validget valid(): boolean;Read-only
validationMessageget validationMessage(): string;Read-only
onChangeset onChange(handler: WebComponentEventHandler<this> | null);Read and write
onInputset onInput(handler: WebComponentEventHandler<this> | null);Read and write

focus

method
focus(options?: FocusOptions): void;
Example
Date1.focus
Date1.focus({ preventScroll: true });

checkValidity

method
checkValidity(): boolean;
Example
Date1.checkValidity
Date1.checkValidity();

reportValidity

method
reportValidity(): boolean;
Example
Date1.reportValidity
Date1.reportValidity();

clear

method
clear(): void;
Example
Date1.clear
Date1.clear();

setNow

method
setNow(): void;
Example
Date1.setNow
Date1.setNow();

showPicker

method
showPicker(): boolean;

Opens the calendar aligned to the field, with a minimum popup width of 260px.

Example
Date1.showPicker
Date1.showPicker();

dispose

method
dispose(): void;
Example
Date1.dispose
// Call only when disposing of an instance whose lifecycle you control.
Date1.dispose();
Inherited members (22)
MemberSignatureAccess
currentRowBindingscurrentRowBindings: readonly WebCurrentRowBinding[];Read and write
elementreadonly element: TElement;Read-only
idreadonly id: string;Read-only
namereadonly name: string;Read-only
collapseWhenHiddencollapseWhenHidden: boolean;Read and write
xx: number;Read and write
yy: number;Read and write
widthwidth: number;Read and write
heightheight: number;Read and write
marginOuter spacing on all four sides, in pixels.margin: number;Read and write
marginTopmarginTop: number;Read and write
marginRightmarginRight: number;Read and write
marginBottommarginBottom: number;Read and write
marginLeftmarginLeft: number;Read and write
alignSelfalignSelf: RuntimeLayoutAlignSelf;Read and write
backgroundColorbackgroundColor: string;Read and write
colorcolor: string;Read and write
borderColorborderColor: string;Read and write

show

method
show(): void;

hide

method
hide(): void;

bindEvent

method
bindEvent(eventName: string, handler: WebComponentEventHandler<this> | null): () => void;

emit

method
emit(eventName: string, detail?: unknown): boolean;

Events

Link methods in Interaction. How to use events.

OnChange

Standard event (Event).

Signature and example
Interaction → OnChange
import type { WebDate } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Date1Change(
    sender: WebDate,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}

OnInput

Standard event (Event).

Signature and example
Interaction → OnInput
import type { WebDate } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Date1Input(
    sender: WebDate,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}

OnFocus

Standard event (Event).

Signature and example
Interaction → OnFocus
import type { WebDate } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Date1Focus(
    sender: WebDate,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}

OnBlur

Standard event (Event).

Signature and example
Interaction → OnBlur
import type { WebDate } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Date1Blur(
    sender: WebDate,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}

OnKeyDown

Standard event (Event).

Signature and example
Interaction → OnKeyDown
import type { WebDate } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Date1KeyDown(
    sender: WebDate,
    event: Event,
  ): Promise<void> {
    if (event instanceof KeyboardEvent) console.log(event.key);
  }
}

OnKeyUp

Standard event (Event).

Signature and example
Interaction → OnKeyUp
import type { WebDate } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async Date1KeyUp(
    sender: WebDate,
    event: Event,
  ): Promise<void> {
    if (event instanceof KeyboardEvent) console.log(event.key);
  }
}
WebRAD · Atentor · Read in Markdown
Source code: 6a562bda75a0 (with local changes) · November 7, 2026

Search documentation

Type to search APIs, components, and events.