yiminghe / async-validator

validate form asynchronous
MIT License
8.86k stars 762 forks source link

iview datepicker validator error #78

Open fyeeme opened 6 years ago

fyeeme commented 6 years ago

set datepicker type as daterange

 daterange: [
                        { required: true, type: 'date', message: 'Please select the date', trigger: 'change' }
                    ],

then use this validate it , it occors an error as below: image

image

error is here ,cause it return array and not a empty string or date , how to solve it?

writingbug commented 6 years ago

遇到同样的问题

luke-oakes commented 6 years ago

Would it be possible for the validator to attempt to convert a string to Date before doing the date validate?

funnycoderstar commented 6 years ago

I have encountered the same problem

Nuoky commented 5 years ago
{
     required: true, type: 'array', trigger: 'change',
     fields: {
        0: {type: 'date', required: true, message: 'Please select the date'},
        1: {type: 'date', required: true, message: 'Please select the date'}
      },
}