Skip to main content

Date and Time Picker

Allows users to select a date, time, or combined date-time value from a structured input. Use in forms wherever a precise date or time value is required. Don't use for simple date-only input where time is irrelevant.

Figma Storybook Docs

Description

What it does

Provides a structured input for capturing date, time, or combined date-time values. It presents a calendar picker and/or time selector that reduces manual text entry errors and enforces a consistent date format across forms.

Where it appears

Consultation scheduling forms, stakeholder meeting bookings, event creation workflows, deadline and due date fields, and any form field requiring a specific point in time or calendar date.

Why it exists

Free-text date fields produce inconsistent formats and validation failures that frustrate users and corrupt data. A structured picker enforces a valid value at point of entry, reducing downstream data quality issues in government records and consultation management.

Anatomy

PartRequired?Notes
Field label Required Visible label associated via for/id. Must describe the expected value — for example, 'Consultation close date' or 'Meeting start time'. Do not rely on placeholder text as a label.
Date input segment Required Structured text input or segmented day/month/year fields. Accepts keyboard entry and is connected to the calendar popover.
Time input segment Optional Hour and minute fields, with optional AM/PM toggle for 12-hour format. Only present in date-time or time-only variants.
Calendar trigger button Recommended Icon button (calendar icon) that opens the calendar popover. Must be keyboard-accessible and labelled with aria-label.
Calendar popover Recommended Floating panel containing a month grid. Includes previous/next month navigation and today highlight. Dismissed on selection or Escape.
Month/year navigation Required Controls inside the calendar popover for stepping through months and years. Must be operable by keyboard.
Helper text Optional Supplementary guidance below the input, such as expected format ('DD/MM/YYYY') or constraints ('Must be a future date').
Error message Recommended Replaces or follows helper text when validation fails. Must be linked to the input via aria-describedby.
Clear button Optional Allows the user to remove a selected value. Only shown when a value is present and the field is not required.

Variants

Date only

Captures a calendar date without a time component

Use for deadline dates, publication dates, event dates, or any context where time of day is not relevant — for example, a consultation close date.

Time only

Captures a clock time without a calendar date

Use when the date is already established by context and only the time needs to be set — for example, a recurring meeting time.

Date and time

Captures a precise moment combining both date and time

Use for scheduling specific events such as a stakeholder briefing, a consultation session start time, or a notification send time.

Date range

Captures a start date and an end date as a pair

Use for consultation windows, reporting periods, or filtering by date span. Both fields share a single calendar popover with range highlighting.

States

State Behaviour
Default Input is empty and ready for interaction. Label and optional helper text are visible.
Focused 3px focus ring using --op-color-interactive-focus appears on the active input segment or trigger button. Calendar popover opens when the trigger button receives focus and Enter/Space is pressed, or on click.
Filled A selected value is displayed in the input. The clear button appears if the field is clearable.
Open (calendar popover visible) The calendar popover is displayed. The trigger button is in a pressed state (aria-expanded='true'). Focus moves into the popover grid.
Disabled Input and trigger button are non-interactive. Text renders at reduced opacity using --op-color-text-disabled. Not submitted with the form.
Read-only Value is displayed but cannot be changed. Input has readonly attribute. Trigger button is hidden or non-interactive. Value is submitted with the form.
Error Border changes to --op-color-status-error. Error message appears below the input, linked via aria-describedby. The error persists until a valid value is entered.
Loading Used when available dates are fetched asynchronously (for example, checking consultant availability). A spinner replaces or overlays the calendar while data loads.

Usage guidelines

When to use

  • Setting a consultation close date or submission deadline in Open Point.
  • Scheduling a stakeholder meeting or briefing session with a specific start date and time.
  • Defining a date range for a community engagement period in Social Point.
  • Setting a notification or reminder dispatch time in an automated workflow.
  • Capturing a due date for a task or action item in a stakeholder record.

When not to use

  • When only a year or a month/year is needed — use separate select inputs instead to avoid presenting an unnecessarily complex calendar.
  • When the date is relative and imprecise (for example, 'in about two weeks') — use a plain text input or a duration selector.
  • When the user is filtering or searching across a large date range — consider a dedicated date range filter component built for that context.
  • When the date is not required and would rarely be provided — make it optional and clearly label it as such, or omit it entirely.

Do / Don't

Do

Label the field with specific, plain-language text that describes the value being captured, such as 'Consultation open date' or 'Meeting start time'.

Don't

Use generic labels like 'Date' or 'Pick a date' that leave users uncertain about what value is expected.

Do

Show the expected format in helper text when using a text-entry date input, for example 'DD/MM/YYYY'.

Don't

Rely on placeholder text alone to communicate the expected format — placeholder text disappears on focus and is not reliably read by screen readers.

Do

Set sensible min and max date constraints to prevent invalid input — for example, preventing a consultation close date from being set in the past.

Don't

Allow users to select dates outside a valid range and then surface a validation error after submission.

Do

For date-time fields, confirm the user's timezone where it is relevant to the action, particularly for scheduled notifications or cross-jurisdiction consultations.

Don't

Silently assume server timezone without surfacing it to the user, which can cause missed meetings or incorrectly timed notifications.

Do

Preserve a partially entered value when the user navigates away and returns, where the form supports draft saving.

Don't

Clear the field silently if the user opens and closes the popover without selecting a date — this is disorienting.

Was this page helpful?

Updated 9 September 2026