bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

datepicker - exception thrown with 0.11.0

Open Daxx909 opened this issue 12 years ago • 2 comments

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 avatar May 07 '14 13:05 Daxx909

@Daxx909 could you try to narrow it down in a plunker? This would speed up resolution. Thnx!

pkozlowski-opensource avatar May 07 '14 16:05 pkozlowski-opensource

This seems to be a duplicate of https://github.com/angular-ui/bootstrap/pull/2137

kherrala avatar May 07 '14 17:05 kherrala