-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Prerequisites
- I have searched the existing issues
- I understand that providing a SSCCE example is tremendously useful to the maintainers.
- I have read the documentation
- Ideally, I'm providing a sample JSFiddle, Codesandbox.io or preferably a shared playground link demonstrating the issue.
What theme are you using?
mui
Version
5.18.3
Current Behavior
Issue : minimum and maximum validations do not work in RJSF JSON FORM DATE PICKER COMPONENT
This is an existing issue with the RJSF library itself.
-
The RJSF schema expects minimum and maximum to be number.
-
However, the html element with type = ‘date’ expects min to be a string of format ‘yyyy-mm-dd’ Check here
Case 1 : In the RJSF schema, if we pass minimum = dayjs().format(“YYYY-MM-DD”) i.e. a string. The datePicker works as expected but while submitting the form validation error is thrown
schema is invalid: data/properties/startDate/minimum must be number, data/properties/endDate/minimum must be number
Case 2 : If we try converting the minimum to number something like this dayjs().valueOf() -> then validation works fine but datePicker wont work as expected because min will be number and wont work on (Refer below screenshots)

Expected Behavior
No response
Steps To Reproduce
JSON SCHEMA :
{
type: "object",
required: ["startDate"],
properties: {
startDate: {
type: "string",
title: "Start Date",
format: "date", // Ensures only YYYY-MM-DD format
minimum: dayjs().format("YYYY-MM-DD")
default: dayjs().format("YYYY-MM-DD")
},
}
}
Environment
- OS:
- Node:
- npm:
Anything else?
No response