kekeh / angular-mydatepicker

Angular datepicker and date range picker :date:
https://kekeh.github.io/angular-mydatepicker/
MIT License
1 stars 11 forks source link

Date & Month defaulting to current month and Date #79

Closed nagasudhakarch closed 3 years ago

nagasudhakarch commented 3 years ago

in any of the Date formats if the date & months entered as ZEROs, the date & month defaulting to current. For ex-

  1. date format is dd.mm.yyyy
  2. entered date as 00.00.2010.
  3. date automatically changing to 10.04.2010 on leaving the field (month & dates are defaulted to current month and date).

Issue is happening here (https://kekeh.github.io/angular-mydatepicker/) also.

kekeh commented 3 years ago

Hello @nagasudhakarch

Try to set the inputFieldValidation option to false.

nagasudhakarch commented 3 years ago

Hi kekeh, I tried that option but no luck. With inputFieldValidation option in the input field it is showing 00.00.2010 only. But the control value is getting changed to 04.11.2010. Please check sample at - https://stackblitz.com/edit/angular-puxw3k?file=src%2Fapp%2Fapp.component.html

kekeh commented 3 years ago

Hello @nagasudhakarch

I fixed the bug. Install new version of the component: 0.11.2.

Try fixed version here: https://stackblitz.com/edit/angular-2oljde?file=src%2Fapp%2Fapp.component.ts

Now you can keep default value of inputFieldValidation.

nagasudhakarch commented 3 years ago

Hi Kekeh, The fix is working fine. Thank you for the fix. But I found one more issue, if I make the inputFieldValidation option false and enter date manually dateChanged event not getting triggered even for valid Date.

Thanks, Sudhakar

kekeh commented 3 years ago

If you want that dateChanged is triggered on blur event of input box you have to set inputFieldValidation to true.