React-jsonschema-form: date format validation does not play with type=date

Created on 3 May 2016  路  8Comments  路  Source: rjsf-team/react-jsonschema-form

Description

type=date format validation is not working

Steps to Reproduce

  1. Navigate to https://jsfiddle.net/kaihendry/08d3reth/ in Chrome or some other browser that implements type=date http://caniuse.com/#feat=input-datetime
  2. Choose a date
  3. See a validation error http://s.natalian.org/2016-05-03/1462255048_2558x1404.png

    Expected behavior

Should be considered a valid date

Actual behavior

does not conform to the "date" format

Version

https://npmcdn.com/[email protected]/dist/react-jsonschema-form.js

bug

Most helpful comment

Can somebody Please help me with how to change the date format? for eg - by default it take "YYYY-MM-DD" and I want "MM-DD-YYYY".

All 8 comments

jsonschema seems to have strong expectations for the date string format, which should be YYYY-MM-DD.

I'm surprised we missed a failing test case.

I know; there's currently no support for "date" string format as it's not part of the current draft-v4 spec (only "date-time" is). But jsonschema, for some reason, supports a custom "date" format.

Hence why expecting a datetime it fails here. I'll probably add support for the "date" string format though, as datetimes are definitely overkill for birth dates.

I'll probably add support for the "date" string format though, as datetimes are definitely overkill for birth dates.

:+1:

Hmm, https://npmcdn.com/react-jsonschema-form/dist/react-jsonschema-form.js still points to 0.28.1. Is there an automatic build of this change? Thank you !

v0.29.0 has just been released featuring this change.

Can somebody Please help me with how to change the date format? for eg - by default it take "YYYY-MM-DD" and I want "MM-DD-YYYY".

should match format date . error when I try to submit the form .

Can somebody Please help me with how to change the date format? for eg - by default it take "YYYY-MM-DD" and I want "MM-DD-YYYY".

We currently don't support a different date format with the default date widget.

Was this page helpful?
0 / 5 - 0 ratings