Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Value and onChange

The picker holds one UTC instant: value is an ISO string, and onChange gives back the new one (React only; Razor posts it under name).

One instant from a date and a time
AppDateTimePicker captures one moment. The person picks a date and a time of day in India Standard Time, and the field posts one UTC instant, so storage stays in UTC while the screen shows the time they expect. The value 2026-03-14T04:00:00Z shows as 14-Mar-2026 and 09:30. Until both parts are set the field posts an empty value, and clearing either part clears it.
Times are shown in IST.

Posts: 2026-03-14T04:00:00.000Z

Show code
<app-date-time-picker label="Starts at" name="startsAt" value="2026-03-14T04:00:00Z"></app-date-time-picker>
<p>Posts: 2026-03-14T04:00:00.000Z</p>

Min and max

Constrain the selectable dates so an invalid slot cannot be picked.

Restrict to a valid window
Min and max are UTC instants. The date picker limits to the dates they fall on in the field's zone.
Times are shown in IST.
Show code
<app-date-time-picker label="Delivery slot" name="slot" value="2026-03-14T04:00:00Z" min="2026-03-10T00:00:00Z" max="2026-03-20T00:00:00Z"></app-date-time-picker>

Zone

Read and enter the pair in the zone your people plan in; the note under the field names it.

Read in another zone
The zone changes only how the date and time are read and entered. The same instant shows as 04:00 here.
Times are shown in UTC.
Show code
<app-date-time-picker label="Meeting" name="meeting" value="2026-03-14T04:00:00Z" zone="UTC"></app-date-time-picker>

States

Disable a field that cannot change now, and mark a field that must be filled as required.

Disabled, required, and error
Times are shown in IST.
Times are shown in IST.
Times are shown in IST.
Pick a date and a time
Show code
<app-date-time-picker label="Locked" name="stLocked" value="2026-03-14T04:00:00Z" disabled="true"></app-date-time-picker>
<app-date-time-picker label="Starts at" name="stRequired" required="true"></app-date-time-picker>
<app-date-time-picker label="Starts at" name="stError" error="Pick a date and a time"></app-date-time-picker>

Every option

Every value of every prop, one cell each.

value

value=""
Times are shown in IST.
value="2026-03-14T04:00:00Z"
Times are shown in IST.

onChange

onChange is React only, so Razor posts the UTC instant under name
Times are shown in IST.

min / max: bounds

min="2026-03-10T00:00:00Z" (no max)
Times are shown in IST.
max="2026-03-20T00:00:00Z" (no min)
Times are shown in IST.
min and max together
Times are shown in IST.

zone

zone="Asia/Kolkata" (default)
Times are shown in IST.
zone="UTC"
Times are shown in UTC.
zone="America/New_York"
Times are shown in America/New_York.

disabled

disabled="false" (default)
Times are shown in IST.
disabled="true"
Times are shown in IST.

readOnly

read-only="false" (default)
Times are shown in IST.
read-only="true"
Times are shown in IST.

label

label="Starts at"
Times are shown in IST.

required

required="false" (default)
Times are shown in IST.
required="true"
Times are shown in IST.

optional

optional="false" (default)
Times are shown in IST.
optional="true"
Times are shown in IST.

optionalLabel

optional-label="(optional)" (default)
Times are shown in IST.
optional-label="Not needed"
Times are shown in IST.

helperText

helper-text="Pick the slot the delivery starts"
Pick the slot the delivery starts

error

error="Pick a date and a time"
Times are shown in IST.
Pick a date and a time

name

name="startsAt" posts the UTC instant, no visible change
Times are shown in IST.

id

id="starts-at" sets the control id, no visible change
Times are shown in IST.

className

input-class="rounded-3"
Times are shown in IST.

fieldClassName

class="mb-3" adds classes to the field wrapper
Times are shown in IST.

defaultValue

defaultValue has no Razor attribute; value sets the starting instant
Times are shown in IST.

help

help="Pick when the delivery starts." adds an info tip
Times are shown in IST.

helpLabel

help-label="More information" (default)
Times are shown in IST.
help-label="About this slot"
Times are shown in IST.

Guidance

What to do, and what to avoid.

Use it when

  • Capturing one instant a person sets by date and time: a meeting start, a deadline, a scheduled send.
  • The value must be stored in UTC and shown in IST.

Reach for something else when

  • You need only a calendar date. → AppDatePicker
  • You need only a time of day. → AppTimePicker

Reference

Try every prop, read the full list, and check keyboard and screen reader behaviour.

Asia/Kolkata UTC Europe/London America/New_York Asia/Tokyo
Times are shown in IST.
React, generated from the controls
<AppDateTimePicker label="Starts at" name="pgStartsAt" value={value} onChange={setValue} />
Razor, the same props
<app-date-time-picker label="Starts at" name="pgStartsAt" />

17 props. The 5 most used come first.

Used on most screens 5 props

PropTypeDefaultDescription
labeldefault - string - The field label, shown above the controls and used as the date control's accessible name.
valuedefault - string - The instant as an ISO UTC string (for example 2026-03-14T04:00:00Z); written as 2026-03-14T04:00:00.000Z.
zonedefault Asia/Kolkata string Asia/Kolkata The IANA zone the date and time are read and entered in. Default IST.
requireddefault false bool false Marks the field required, with the required mark on the label.
errordefault - string - An error message shown under the controls.

Less common 12 props

PropTypeDefaultDescription
namedefault - string - The form field name the UTC instant posts under.
mindefault - string - The earliest selectable date, as an ISO UTC string; its date in the zone is used.
maxdefault - string - The latest selectable date, as an ISO UTC string; its date in the zone is used.
optionaldefault false bool false Ends the label with (optional) when the field is not required. Required wins when both are set.
optional-labeldefault (optional) string (optional) Replaces the built-in English text, for other languages.
helper-textdefault - string - Replaces the zone note shown under the controls.
disableddefault - bool - Disables both controls.
read-onlydefault false bool false Shows the value but blocks editing. The value still posts.
helpdefault - string - Info-tip content shown beside the label.
help-labeldefault More information string More information The accessible name of the info-tip button.
iddefault - string - The id of the control; the date control takes the id with -date added. A unique one is made when left out.
input-classdefault - string - Extra classes on the control itself. The plain class attribute merges onto the field wrapper that holds the label, note and error instead.

Screen reader

4 notes
  • The date control is named by the field label, and the time control carries its own name.
  • An error sets aria-invalid and points aria-describedby at the error text, or at the helper text when there is no error.
  • Both controls carry the required attribute as well as the visible required mark.
  • The info tip beside the label is named by helpLabel.