Is there a way to set the minimum date in the JSON Schema Form? With min it’s not working, here is an example:
{
"title": "Date picker",
"type": "object",
"properties": {
"native": {
"title": "Title",
"description": "description",
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date",
"default": "2023-10-26",
"min": "2023-10-26"
}
}
}
}
}
2
Answers
min
is not a json schema keyword.minimum
is, but it only works on numbers, not strings.In the currently-released versions of JSON Schema you can achieve some approximation to a minimum check by using regular expressions:
I found this page and it helped –
https://github.com/rjsf-team/react-jsonschema-form/issues/2118