Skip to content

feat: let a date node pick a time - #174

Merged
lero62 merged 1 commit into
mainfrom
feat/date-with-time
Oct 7, 2026
Merged

lero62 merged 1 commit into
mainfrom
feat/date-with-time

Conversation

@lero62

@lero62 lero62 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

A date node held a time already — its value is an ISO string — but there was no way to set one.
Payload's DatePicker defaults to the default appearance, and that appearance does not merely hide
the clock: onChange rewrites whatever was picked to noon local time. So the time was not missing
from the form, it was being thrown away on every pick.

time: true on a date node switches the picker to dayAndTime, which leaves the chosen time alone.
It is an ordinary optional parameter, beside min/max on a number and minRows/maxRows on a
list: registered in KEYS as a boolean that only a date may carry, so Code cannot put it anywhere
else, and offered in the builder's settings as Pick a time as well. The default value picker in
those same settings follows the switch, so what an admin sets as the default is what an editor sees.

Left opt-in rather than made the default on purpose. Noon is a safe place for a day-only date: it
survives a render in any timezone without sliding to the previous or next day, and every date node
that exists today was written that way. Turning the clock on for all of them would put midnight
within reach of a careless click and move dates across the date line for the sites that format them
locally.

Nothing changes for a node without the key: same appearance, same noon, same stored shape. The site
is untouched either way — flatten hands a date over as the ISO string it always was.

Checked by hand: the parameter passes validation on a date, is refused on a text node ("time is only
for date") and refused when it is not a boolean; a date without it behaves exactly as before.

@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ideal-cms Ready Ready Preview Oct 7, 2026 5:24pm UTC

Request Review

@lero62
lero62 merged commit 8185953 into main Oct 7, 2026
2 checks passed
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.4.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

This branch was successfully deployed

1 active deployment
Preview — 87a6e6e7 Deployed Oct 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant