koumoul-dev / vuetify-jsonschema-form

Create beautiful and low-effort forms that output valid data. Published on npm as @koumoul/vjsf.
https://koumoul-dev.github.io/vuetify-jsonschema-form/latest/
MIT License
538 stars 154 forks source link

Support for Date range picker #340

Open GregoireBailly opened 2 years ago

GregoireBailly commented 2 years ago

Hi,

I'd like to use vjsf to get a date range picker (https://vuetifyjs.com/en/components/date-pickers/#range).

I tried using "x-props": {"range": true} but it's not changing anything (in the same spot "x-props": { "outlined": true } is working properly).

I guess when using the type string with format date, the props are only passed through to and not to .

Does anyone know about this issue ? Is there anyway to implement a quick work-around ?

Here is part of my json file : "properties": { "periode": { "title": "Période", "type": "string", "format": "date", "description": "Période pour laquelle on saisit la consommation", "x-props": {"range": true} },

albanm commented 2 years ago

I think the problem is more complicated than passing the prop to the right component. Your model would be invalid here as the range mode of the date-picker would return an array while you declare a simple string with date format.

I will add this to the roadmap, but I don't know when I will have time to work on it.

In the meantime you could use advanced slot integration https://koumoul-dev.github.io/vuetify-jsonschema-form/latest/examples#slots-wrappers

GregoireBailly commented 2 years ago

Ok, thanks a lot for the quick answer :)