Limenius / liform-react

Generate forms from JSON Schema to use with React (& redux-form)
https://limenius.github.io/liform-react/
MIT License
174 stars 40 forks source link

fixed DateTimeWidget to generate a value according to json schema date-time format #50

Open pavel-kh opened 6 years ago

pavel-kh commented 6 years ago

There was a problem with DateTimeWidget, it generated a value not according to json schema date-time format, which is YYYY-MM-DDTHH:mm:ssZ (the generated value was of YYYY-MM-DDTHH:mm format). For example for schema like this one

const schema = {
      title: "A schema", 
      properties: {
        datetime: {
          type: "string",
          format: "date-time",
          widget: "datetime"
        }
      },
      required: ["datetime"]
};

you couldn't enter a valid value using DateTimeWidget