Skip to content

feat: Add Date field type for booking questions #26901

@mamisoa

Description

@mamisoa

Feature Request

Is your feature request related to a problem?

Currently, Cal.com booking questions support various field types (text, textarea, number, phone, email, select, multiselect, checkbox, radio, boolean, url), but there is no native date picker field type.

Users who need to collect date information from attendees (e.g., date of birth, preferred follow-up date, document expiry date) must use a text field, which leads to:

  • Inconsistent date formats from attendees
  • No validation for date ranges
  • Poor user experience without a calendar widget

Describe the solution you'd like

Add a new "date" field type to the booking questions feature with:

  1. Date picker UI: Use the existing DatePicker component from @calcom/ui
  2. Configurable date formats:
    • yyyy-MM-dd (ISO, default)
    • dd/MM/yyyy (European)
    • MM/dd/yyyy (US)
    • dd.MM.yyyy (German)
  3. Min/Max date constraints with support for:
    • Absolute dates: 2024-01-01
    • Relative dates: today, today+7d, today-30d, today+365d
  4. Server-side validation via Zod schema
  5. Platform API support with a new DateFieldInput_2024_06_14 class

Use Cases

  • Healthcare: Collect patient date of birth
  • Legal/Compliance: Request document expiry dates
  • Sales: Ask for preferred callback date
  • Events: Collect attendee arrival dates
  • HR: Request availability start date

Implementation Scope

Files that would need modification:

  • packages/prisma/zod-utils.ts - Add "date" to fieldTypeEnum and date options to baseFieldSchema
  • packages/features/form-builder/fieldTypes.ts - Add date config
  • packages/features/form-builder/propsTypes.ts - Add date propsType
  • packages/features/form-builder/Components.tsx - Add DateField component
  • packages/features/form-builder/FormBuilderField.tsx - Add date case
  • packages/features/form-builder/schema.ts - Add Zod validation for date
  • apps/web/modules/event-types/components/tabs/advanced/FormBuilder.tsx - Add date config UI
  • packages/platform/enums/event-types/field-type.ts - Add to BaseFieldEnum
  • packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-fields.input.ts - Add API input class

Additional context

I have a working implementation ready and would be happy to submit a PR if this feature request is approved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions