Skip to content

Dates & calendar

Segmented controls (UInputDate / UInputTime) or an inline calendar (UCalendar).


Date / Date-time / Time — segmented fields

Trigger:

  • schema format: "date" | "date-time" | "time", or
  • options.format: "date" | "time" | "date-time"

API

NameTypeDefaultDescription
format"date" | "time" | "date-time"(schema)Control type when the schema has no format.
patternStringper formatdayjs storage / display format (YYYY-MM-DD, HH:mm, YYYY.MM, YYYY, …).
localeString"fr-FR"Locale of the popover calendar.
monthsNumberNumber of months shown in the popover.
weekNumbersBooleanShows week numbers.
minDateStringInclusive lower bound (YYYY-MM-DD, YYYY-MM or YYYY).
maxDateStringInclusive upper bound.
disabledDatesString[]Excluded days (YYYY-MM-DD).
disabledWeekdaysNumber[]Excluded weekdays (0 = Sunday … 6 = Saturday).
disabledMonthsNumber[]Excluded months (112).
disabledYearsNumber[]Excluded years.
inputDateObjectPass-through → UInputDate.
inputTimeObjectPass-through → UInputTime.
calendarObjectPass-through → the popover calendar.
calendarCardObjectPass-through to the calendar card.
timeCard / timeHour / timeMinute / timeSecondObjectPass-through to the time parts.

Examples

json
{
  "type": "string",
  "format": "date",
  "title": "Start date"
}
json
{
  "type": "Control",
  "scope": "#/properties/startDate",
  "options": {
    "pattern": "YYYY-MM-DD",
    "locale": "en-US",
    "minDate": "2026-01-01",
    "maxDate": "2026-12-31",
    "disabledWeekdays": [0, 6]
  }
}

Month / year precision:

json
{
  "type": "Control",
  "scope": "#/properties/period",
  "options": {
    "format": "date",
    "pattern": "YYYY-MM"
  }
}

Time only:

json
{
  "type": "Control",
  "scope": "#/properties/opening",
  "options": {
    "format": "time",
    "pattern": "HH:mm"
  }
}

Calendar — inline UCalendar

Trigger: options.format: "calendar".

API

All the date constraints above (minDate, disabledDates, …) plus:

NameTypeDefaultDescription
format"calendar"Required.
rangeBoolean{ start, end } range selection (an object schema is recommended).
monthsNumber2 when rangeNumber of months side by side.
calendarObjectPass-through → UCalendar.

Examples

Simple calendar:

json
{
  "type": "Control",
  "scope": "#/properties/day",
  "options": {
    "format": "calendar",
    "weekNumbers": true
  }
}

Range with constraints:

json
{
  "type": "object",
  "properties": {
    "start": { "type": "string", "format": "date" },
    "end": { "type": "string", "format": "date" }
  }
}
json
{
  "type": "Control",
  "scope": "#/properties/stay",
  "options": {
    "format": "calendar",
    "range": true,
    "months": 2,
    "minDate": "2026-08-01",
    "maxDate": "2026-09-30",
    "disabledWeekdays": [0, 6],
    "disabledDates": ["2026-08-15"]
  }
}

Playground

Released under the BSD-3-Clause License.