fragaria / angular-daterangepicker

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

Date picker resets the date to nearest valid date when a users manually enters a date that is less than min date or greater than max date. #316

Open Knksumanth opened 3 years ago

Knksumanth commented 3 years ago

This isnt really an issue., but there should be a way to figure out when this happens and to show a message to user.

To detect this change, I found that in the date object , there is an overflow flag which is set to -2 when a invalid date is picked and -1 when valid date is picked. I have tried many times with many different dates and although I am sure that I can go ahead and use this value to detect this kind of auto changing of the date., I also wanted to check if there is any better way of either stopping this auto resetting of the date, or right way to detect this change/date reset.?