admin管理员组文章数量:1426810
Using this library: I want to add a date selector field and here in the documentation is says:
date: By default, an input[type=date] element is used;
date-time: By default, an input[type=datetime-local] element is used.
and they posted this picture, I want mine to look the same as the date one:
I use last version of Chrome, for the patibility issue.
I've try to write something like this:
date: {
type: "date",
title: "Date"
}
but I got this error:
Unsupported field schema for field root_date: Unknown field type date.
Check this fiddle:
/
Using this library: https://github./mozilla-services/react-jsonschema-form I want to add a date selector field and here in the documentation is says:
date: By default, an input[type=date] element is used;
date-time: By default, an input[type=datetime-local] element is used.
and they posted this picture, I want mine to look the same as the date one:
I use last version of Chrome, for the patibility issue.
I've try to write something like this:
date: {
type: "date",
title: "Date"
}
but I got this error:
Unsupported field schema for field root_date: Unknown field type date.
Check this fiddle:
https://jsfiddle/bogdanul11/69z2wepo/91003/
Share Improve this question asked Nov 9, 2017 at 14:31 Tatu BogdanTatu Bogdan 5962 gold badges11 silver badges29 bronze badges1 Answer
Reset to default 4You should define the json shema as following:
"datetime": { // whatever name you want
"type": "string", //Attention!
"format": "date-time"
},
instead of what you did:
date: {
"type": "date",
"title": "Date"
}
The react-jsonschema-form library provides really nice playground: https://mozilla-services.github.io/react-jsonschema-form/
本文标签: javascriptHow to add type date for reactjsonschemaformStack Overflow
版权声明:本文标题:javascript - How to add type: date for react-jsonschema-form - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745485989a2660385.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论