StaticJsCMS / static-cms

A Git-based CMS for Static Site Generators
https://staticjscms.netlify.app/
MIT License
591 stars 53 forks source link

DateTime field - default value of `""` (empty string) and `required: false` causes the field to have datetime format mask inside it #1051

Closed dallyh closed 5 months ago

dallyh commented 9 months ago

Hello,

when there is a DateTime field in a collection, and the field is set like this:

        {
          "name": "modDatetime",
          "label": "Modified Date",
          "widget": "datetime",
          "i18n": "duplicate",
          "required": false,
          "date_format": true,
          "time_format": true,
          "default": ""
        },

Then in the UI, when a new entry is created, the field is filled with datetime format mask: image

This started happening on version 4.0.0, previous versions were fine. When an entry like this is saved, actual field has "" (empty string) inside it, so just looks like a UI issue.

KaneFreeman commented 5 months ago

What you are seeing is only a placeholder and is not actually saved. It is simply how the MUI datepicker works in the most recent version. Addressing this would require replacing MUI as the component library we use for datepickers, which is not something we are looking to do.