foundation-datepicker icon indicating copy to clipboard operation
foundation-datepicker copied to clipboard

Date validation failed because check (date && date.length > this.formatText.length) / but date is valid

Open WERMESTER opened this issue 7 years ago • 3 comments

Version : 1.5.6 Datepicker configuration : { weekStart: 1, format: 'm/d/yyyy' }

in my case i would a date without 0 when days or months are less than 10 so i used this pattern 'm/d/yyyy'. but when i selected a date like '3/28/2017' date validation failed becasue of this test Line 434

            if (date && date.length > this.formatText.length) {
                    $(this.picker).addClass('is-invalid')
                    $(this.element).addClass('is-invalid-input')
                    return;
            }

but my selected date is valid

WERMESTER avatar Mar 28 '17 11:03 WERMESTER

Same here - this validation doesn't respect full month names, like 'M' or 'MM'

lessless avatar Apr 14 '17 04:04 lessless

Also see #176

derekjones avatar Aug 24 '17 19:08 derekjones

I get an "Invalid date" when using format dd/mm/yyyy on days 13 and above.

EFXPROMedia avatar Oct 23 '17 21:10 EFXPROMedia