> ## Documentation Index
> Fetch the complete documentation index at: https://docs.penbox.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Date Field

> Date picker for birth dates, deadlines, and timestamps

The Date field provides a date picker interface for capturing date values. Date fields enable date-based comparisons, calculations, and automations, making them essential for deadlines, birth dates, start dates, and any time-sensitive data.

Use Date fields whenever you need to track when something happened or when something is due. Date fields provide built-in validation, consistent formatting, and enable powerful date-based automations and filtering.

## When to Use

**Use Date fields for:**

* Birth dates and ages
* Deadlines and due dates
* Start and end dates
* Incident or claim dates
* Contract dates (signature, expiration)
* Submission dates
* Approval dates
* Any date that drives workflow logic

**Consider alternatives:**

* Use **Text** for date ranges or free-form date descriptions
* Use **Number** for year-only values that don't represent actual dates

## Configuration Options

| Option        | Description                   | Type        | Default          | Example               |
| ------------- | ----------------------------- | ----------- | ---------------- | --------------------- |
| `key`         | Unique identifier             | String      | Required         | `birth_date`          |
| `name`        | Display label                 | String      | Required         | "Date of Birth"       |
| `description` | Help text for users           | String      | Optional         | "Your date of birth"  |
| `min`         | Earliest allowed date         | Date string | None             | `1900-01-01`          |
| `max`         | Latest allowed date           | Date string | None             | `2026-12-31`          |
| `format`      | Display format                | String      | `YYYY-MM-DD`     | `DD/MM/YYYY`          |
| `default`     | Default value                 | Date string | None             | `today`, `2026-01-01` |
| `visibility`  | Display setting               | String      | `always-visible` | `hide-when-empty`     |
| `section`     | Section this field belongs to | String      | None             | Section UUID          |

## Examples

### Birth Date

Collect date of birth with reasonable validation:

```json theme={null}
{
  "key": "birth_date",
  "type": "date",
  "name": "Date of Birth",
  "description": "Your date of birth",
  "min": "1900-01-01",
  "max": "today"
}
```

### Deadline Date

Set a future deadline:

```json theme={null}
{
  "key": "submission_deadline",
  "type": "date",
  "name": "Submission Deadline",
  "description": "Documents must be submitted by this date",
  "min": "today",
  "default": "+30days"
}
```

### Incident Date

Collect when an event occurred:

```json theme={null}
{
  "key": "incident_date",
  "type": "date",
  "name": "Incident Date",
  "description": "When did the incident occur?",
  "max": "today"
}
```

### Contract Expiration

Track contract end date:

```json theme={null}
{
  "key": "contract_expiration",
  "type": "date",
  "name": "Contract Expiration Date",
  "description": "When this contract expires",
  "min": "today"
}
```

## Validation

Date fields provide automatic validation:

### Format Validation

* Only valid dates accepted
* Prevents impossible dates (February 30, month 13, etc.)
* Handles leap years correctly
* Consistent date format across platform

### Range Validation

* `min` - Earliest allowed date
* `max` - Latest allowed date
* Use `today` as dynamic value for current date
* Use relative values like `+30days`, `-1year`

### Special Values

* `today` - Current date
* `+Ndays` - N days from today (e.g., `+30days`)
* `-Ndays` - N days before today (e.g., `-7days`)
* `+Nmonths` - N months from today
* `+Nyears` - N years from today

## Date-Based Automations

Date fields enable powerful date-based automations:

**Deadline reminders:**

* Send reminder 7 days before deadline
* Escalate when deadline passes
* Update status based on deadline proximity

**Age calculations:**

* Calculate age from birth date
* Determine eligibility based on age
* Trigger different workflows for age groups

**Time-based transitions:**

* Move to "Overdue" if response not received by deadline
* Archive cases after 90 days from closure date
* Trigger renewal workflow 30 days before expiration

**Date comparisons:**

* Ensure start date is before end date
* Check if incident date is within policy coverage period
* Validate dates fall within reasonable ranges

[Learn more about Automations →](/cases/automations)

## Best Practices

**Use Date fields for all date values:**

* Don't store dates as text (prevents date-based logic)
* Enables date calculations and comparisons
* Provides consistent date formatting

**Set reasonable min/max:**

* Prevents clearly invalid dates
* Use `today` for dynamic validation
* Consider use case (birth dates should be in past)

**Default values:**

* Use `today` for current date fields
* Use `+30days` for typical deadlines
* Leave blank when user must actively choose

**Consider timezone:**

* Dates are stored in ISO 8601 format
* Display format respects user locale
* Specify timezone requirements in description if critical

***

## Related Field Types

<CardGroup cols={2}>
  <Card title="Number" icon="hashtag" href="/cases/data_schema/number">
    Use for year-only values that aren't specific dates
  </Card>

  <Card title="Text" icon="text" href="/cases/data_schema/text">
    Use for date ranges or free-form date descriptions
  </Card>

  <Card title="Automations" icon="bolt" href="/cases/automations">
    Create date-based workflow automations
  </Card>

  <Card title="Data Schema Overview" icon="sitemap" href="/cases/data_schema">
    Back to Data Schema overview
  </Card>
</CardGroup>
