Unable to Set Date Field to Null via Admin UI

System Information
  • Strapi Version: 4.12.0
  • Operating System: Alpine Linux (Docker container using node:18-alpine )
  • Database: postgresql
  • Node Version: v18.17.0
  • NPM Version: 9.8.1
  • Yarn Version: 1.22.19

Hello Strapi Community,

I am experiencing an issue with the Strapi Admin UI regarding the handling of null values in date fields.

I have a model called banner which contains two date fields, DateStart and DateEnd . Both fields are optional, but when I attempt to clear a previously set date via the UI (using the provided “x” button), the changes aren’t saved. The save button stays disabled after clearing the date, and even after making changes to other fields, the cleared date is not updated in the database.

Here’s the schema for the date fields:

    "DateStart": {
      "pluginOptions": {
        "i18n": {
          "localized": false
        }
      },
      "type": "date",
      "required": false
    },
    "DateEnd": {
      "pluginOptions": {
        "i18n": {
          "localized": false
        }
      },
      "type": "date"
    },

Steps to reproduce the issue:

  1. Set a date for either the DateStart or DateEnd field via the Admin UI.
  2. Save the changes.
  3. Return to the same entity and try to clear the date field using the “x” button next to the date.
  4. Notice that the “Save” button is not enabled, and the changes aren’t saved.

Expected behavior: Clearing the date field should be a valid action that can be saved.

I would appreciate any insights into how I could resolve this issue. Is this a known issue or is there a workaround I can use?

Thank you

1 Like

Same issue, I also try to clear the date and change another filed to trigger the save button but the date still exists

1 Like

Same issue here

EDIT: For me it seems like they will fix it in a near future version: https://github.com/strapi/strapi/pull/17599

1 Like

Should be fixed in 4.12.5, which will be released 16th August, from tomorrow you should be able to use our nightly release which i think is under the next tag.

1 Like