fragaria / angular-daterangepicker

Angular.js wrapper for dangrossman/bootstrap-daterangepicker
MIT License
519 stars 371 forks source link

Invalid Dates are treated as Valid #162

Closed cecilia-sanare closed 5 years ago

cecilia-sanare commented 8 years ago

Currently if a user inputs a format that doesn't match the locale format angular-daterangepicker parses the value and tries to assume what it should be. This creates the unexpected behaviour of isValid resulting in true rather than false.

The following: (Line Link)

moment(value, opts.locale.format)

Should actually be:

moment(value, opts.locale.format, true)

Plnkr to better elaborate on the issue