Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTime fields for Toml Frontmatter should export as DateTimes, not Strings #233

Closed
xelivous opened this issue Oct 24, 2024 · 4 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@xelivous
Copy link

Followup to #228
It seems like datetime widgets are serializing to string format instead of raw datetimes. They can still be interpreted by most frontends in the "incorrect" format but it should still likely be fixed to follow the spec.

What it exports as right now:

+++
date = "2024-10-24T00:00:00"
+++

What it should be:

+++
date = 2024-10-24T00:00:00
+++
@kyoshino
Copy link
Member

I forgot to mention this in #228. I know TOML has date format without quotes, but as per the DateTime widget spec, the data type is a string. I’ll check how Netlify/Decap CMS handles it. If there is incompatibility, I’ll fix it.

@kyoshino
Copy link
Member

Just tested with Decap CMS and it also quoted dates when saving an entry as TOML:

date = "2024-10-25T06:55:00.000Z"

So this would be wontfix.

@kyoshino kyoshino closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2024
@kyoshino
Copy link
Member

kyoshino commented Oct 25, 2024

I’ve found a relevant Netlify/Decap CMS issue and developed a solution for this:

@kyoshino kyoshino reopened this Oct 25, 2024
@kyoshino kyoshino self-assigned this Oct 25, 2024
@kyoshino kyoshino added the enhancement New feature or request label Oct 25, 2024
@kyoshino
Copy link
Member

kyoshino commented Oct 25, 2024

The native date/time format support landed in v0.43.0. Please reload the CMS to see the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants