Skip to content

feat: add date_only collection field type#101

Merged
liamwalder merged 1 commit intodevelopfrom
feat/split-date-fields
Mar 26, 2026
Merged

feat: add date_only collection field type#101
liamwalder merged 1 commit intodevelopfrom
feat/split-date-fields

Conversation

@tristan-mouchet
Copy link
Copy Markdown
Collaborator

@tristan-mouchet tristan-mouchet commented Mar 26, 2026

Summary

Add a new date_only collection field type that stores dates without time components, giving users granular control over whether a field captures a full datetime or just a date. The existing date type remains unchanged as datetime.

Changes

  • Add date_only to CollectionFieldType union and isDateFieldType helper for DRY type checks
  • Render date_only inputs as <input type="date"> (vs datetime-local for datetime fields)
  • Add clampDateInputValue utility to validate and clamp year/month/day while typing
  • Add formatDateOnly display function that formats without timezone conversion
  • Filter format presets for date_only fields to exclude time-related options
  • Update conditional visibility, collection filters, CSV import/export, and MCP tool schemas
  • Rename date label to "Date & Time" and label date_only as "Date" across UI

Test plan

  • Create a collection with both a "Date & Time" field and a "Date" field
  • Add items — verify datetime input shows time picker, date input does not
  • Verify CMS table displays datetime with time and date without time
  • Set a default value on a date_only field in field settings
  • Use inline variables with both field types — confirm format presets exclude time options for date_only
  • Add conditional visibility rules using a date_only field
  • Add collection filter rules using a date_only field
  • Import CSV with date_only values — verify correct parsing
  • Type partial dates (e.g. 5-digit year, month > 12) — verify clamping works
  • Preview and publish a page using date_only fields — verify correct rendering

Made with Cursor

Split date fields into date (datetime) and date_only (date without
time) to give users granular control over date storage and display.

- Add date_only to CollectionFieldType and isDateFieldType helper
- Render date_only inputs as <input type="date"> (vs datetime-local)
- Add clampDateInputValue utility for robust date input validation
- Add formatDateOnly display function (no timezone conversion)
- Filter date_only format presets to exclude time-related options
- Update conditional visibility, filters, CSV, and MCP tools

Made-with: Cursor
@tristan-mouchet tristan-mouchet added the Feature request A new feature request label Mar 26, 2026
@tristan-mouchet tristan-mouchet self-assigned this Mar 26, 2026
@liamwalder liamwalder merged commit d84c44d into develop Mar 26, 2026
2 checks passed
@liamwalder liamwalder deleted the feat/split-date-fields branch March 26, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature request A new feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants