Calendar

Last updated Feb 13, 2026

Calendars allow users to select a specific date or a range of dates. They are presented in a calendar interface that can be navigated month by month. PDS provides two variations: Calendar for selecting a single date, and RangeCalendar for selecting a range of dates with optional presets for relative ranges.

Anatomy of the Calendar component.
  1. Preset (conditional) : predefined relative date configurations.
  2. Navigation controls : arrows for moving between months.
  3. Month and year label : used to indicate the month and year being displayed.
  4. Weekday label : used to indicate the days of the week.
  5. Day label : used to indicate the numeric date.
  6. Active date : indicates a date has been selected.
  7. Highlight date : indicates a date is selected as part of a date range.
PropTypeRequiredDefaultDescription
minDateanyfalse--
maxDateanyfalse--
calendarRefRef<HTMLDivElement> | undefinedfalse--
hidePresetsboolean | undefinedfalse--
onSelectDate((d: CalendarDate) => void) | undefinedfalse--
setDateMode(mode: "end" | "start" | null) => voidtrue--
setValue(value: any) => voidtrue-From setValue of DateRangePicker
granularity"day" | "hour" | "minute" | "second"true--
  • Use Calendar when users need to pick a single date, such as a birthday, due date, or event date.
  • Use RangeCalendar when users need to analyze or filter data across a timeframe (e.g., index tables, analytics).
  • Use presets for common ranges like “Last 7 days” to simplify repetitive tasks.
  • Use a Time Picker when users need to select a specific time of day rather than a date.
  • Use a Select for selecting non-date values like fiscal quarters or weeks if that better matches the user’s mental model.

Do

  • Default to today’s date when it makes sense for the workflow.
  • Provide relative presets for range selection to speed up common tasks.

Don't

  • Overload users with too many presets—stick to the most relevant ones.
  • Hide key instructions; make it clear whether a single date or a range is required.
  • Use semantic markup and proper ARIA roles:
    • role="grid" for the calendar grid.
    • aria-selected to indicate chosen dates.
    • aria-label for navigation buttons (e.g., “Next month”).
  • Ensure full keyboard support.
  • Announce selected dates and ranges via screen readers.
  • Support screen reader context (e.g., “March 2025, 31 days, starting on Sunday”).
  • Use clear labels on inputs (e.g., “Start date,” “End date,” “Select a date”).
  • Format dates consistently across the product (e.g., MMM DD, YYYY).
  • Keep preset labels short and user-friendly (e.g., “Last 7 days,” not “Previous seven days”).
  • Use sentence case for labels and controls.
  • Avoid jargon; align wording with how users naturally talk about time ranges.