keystone icon indicating copy to clipboard operation
keystone copied to clipboard

Cannot set `timestamp` fields to null in Keystone admin panel

Open devmor-j opened this issue 2 years ago • 2 comments

Repro Steps

  1. create a model with a timestamp field (no options passed)
  2. go to admin panel and navigate to that model
  3. create one item and set some value for timestamp field
  4. remove the timestamp value
  5. hit the update button but throws an error saying that "[field x] requires a date to be selected"

Should be able to update and set null value for timestamp fields. Also need to mention that this happens only on keystone panel and not the GraphQL.

I've tried { validation: { isRequired: false } } but didn't work neither. We might have the same issue for calendarDay field as well.

Google Chrome: Version 118.0.5993.117 (Official Build) (64-bit) Nodejs: v18.18.2

Package.json deps:

{
  "dependencies": {
    "@apollo/server-plugin-landing-page-graphql-playground": "^4.0.1",
    "@k6-contrib/list-plugins": "^5.1.0",
    "@keystone-6/auth": "^7.0.2",
    "@keystone-6/core": "^5.7.0",
    "@keystone-6/fields-document": "^8.0.2",
    "compression": "^1.7.4",
    "fast-jwt": "^3.3.1",
    "http-errors": "^2.0.0",
    "typescript": "^5.2.2"
  },
  "engines": {
    "node": "^18.18 || ^20.9"
  }
}

devmor-j avatar Oct 31 '23 19:10 devmor-j

Here's a screenshot of the error message:

image

I am trying to remove startDate and it's not required on the code.

devmor-j avatar Nov 01 '23 16:11 devmor-j