Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Changing month or day in text input from two digits to only one yields undefined on bound scope property #4887

Closed
mzabani opened this issue Nov 12, 2015 · 1 comment

Comments

@mzabani
Copy link

mzabani commented Nov 12, 2015

I'm facing an issue where after editing a datepicker text field with ng-model="someDateObject", someDateObject` becomes undefined. This happens specifically when I change a date such as 12/07/2016 to 12/7/2016 or from 01/07/2016 to 1/07/2016, i.e. when I remove one zero from the month or from the day.

Don't know if it's relevant, but I'm on a pt-BR locale, which is DD/MM/YYYY, on version 0.14.3.

@wesleycho
Copy link
Contributor

Removing a 0 will cause it to be an invalid date given that format.

If you are looking for a looser format, there is currently support for d! and M! flags for optional leading zeroes. If you are looking for invalid dates still being set, keep an eye out for #4837.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants