bootstrap
bootstrap copied to clipboard
datepicker - exception thrown with 0.11.0
Sometimes (async issue?), the datepicker throws an exception. I'm using AngularJS with the Dutch locale (angular-locale_nl.js), version 1.2.6
Exception:
TypError: Unable to get property 'split' of undefined or null reference
at createParser:751:19
at parse:785:7
at parseDate:1478:7
[...]
This is caused by the variable "format" being undefined:
this.parse = function(input, format) {
if ( !angular.isString(input) ) {
return input;
}
format = $locale.DATETIME_FORMATS[format] || format;
if (!this.parsers[format]) {
this.parsers[format] = this.createParser(format);
}
I fixed it on my local machine with:
format = $locale.DATETIME_FORMATS[format] || format;
if (!format) {
return input;
}
And then, even when the anomaly occurs, everything works fine.
@Daxx909 could you try to narrow it down in a plunker? This would speed up resolution. Thnx!
This seems to be a duplicate of https://github.com/angular-ui/bootstrap/pull/2137