Issue: datetime type fields not respecting empty default value #675

Closed
opened 2026-10-05 02:59:51 +02:00 by adam · 2 comments
Owner

Describe the bug

It is not possible to have a datetime field which is empty by default.

To Reproduce
Steps to reproduce the behavior:

With any of these setups, when I create a new file with the "Create content" button the result for this field is as I'd used "default": "{{now}}".

{
  "title": "My field",
  "name": "myfield",
  "type": "datetime",
  "default": ""
}
{
  "title": "My field",
  "name": "myfield",
  "type": "datetime",
  "default": " "
}
{
  "title": "My field",
  "name": "myfield",
  "type": "datetime",
  "default": null
}
{
  "title": "My field",
  "name": "myfield",
  "type": "datetime",
  "default": false
}

Expected behavior

It is possible to have a datetime field which by default is emtpy.

Screenshots

N/A

Device:

  • OS: macOS
  • Front Matter CMS Version: v10.2.1
  • Browser: N/A

Additional context

I'm using the open-vsx extension with VSCodium.

My use case is "modification date" field. On the front end, no modification date is shown if the field is empty. When I make a significant content modification, I update the field's value.

**Describe the bug** It is not possible to have a datetime field which is empty by default. **To Reproduce** Steps to reproduce the behavior: With any of these setups, when I create a new file with the "Create content" button the result for this field is as I'd used `"default": "{{now}}"`. ``` { "title": "My field", "name": "myfield", "type": "datetime", "default": "" } ``` ``` { "title": "My field", "name": "myfield", "type": "datetime", "default": " " } ``` ``` { "title": "My field", "name": "myfield", "type": "datetime", "default": null } ``` ``` { "title": "My field", "name": "myfield", "type": "datetime", "default": false } ``` **Expected behavior** It is possible to have a datetime field which by default is emtpy. **Screenshots** N/A **Device:** - OS: macOS - Front Matter CMS Version: v10.2.1 - Browser: N/A **Additional context** I'm using the [open-vsx extension](https://open-vsx.org/vscode/item?itemName=eliostruyf.vscode-front-matter) with VSCodium. My use case is "modification date" field. On the front end, no modification date is shown if the field is empty. When I make a significant content modification, I update the field's value. <!-- github-sync-id:2537239603 -->
adam closed this issue 2026-10-05 02:59:51 +02:00
Author
Owner

Thanks @olets for opening the issue, I'll take a look at it to see how it can be fixed.

Thanks @olets for opening the issue, I'll take a look at it to see how it can be fixed. <!-- github-comment-id:2363891799 -->
Author
Owner

Fix included in the latest beta and will be part of the v10.4.0 release later this week.

Fix included in the latest beta and will be part of the `v10.4.0` release later this week. <!-- github-comment-id:2367490894 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#675