nathanreyes / v-calendar

An elegant calendar and datepicker plugin for Vue.
https://vcalendar.io
MIT License
4.32k stars 840 forks source link

Type of rules prop in DatePicker is not correct #1347

Open SteveAtClearfield opened 1 year ago

SteveAtClearfield commented 1 year ago

I'm using the date picker with ranges, in TypeScript.

When using a date picker, it works fine as the type of the "rules" prop is DatePartsRules.

However, when using a date range ie "v-model.range='range'" the type of the "rules" prop is not allowed to be an array of DatePartsRules (one for startTime, one for endTime) so this is noted as an error in TypeScript.

Having and array confirms to the examples in the online documentation and runs fine at runtime, however it is the wrong type for TypeScript.

The type of the "rules" prop should therefore be DatePartsRules | DatePartsRules[]