Example:
date = "Tue Apr 18 17:15:13 UTC+0200 2017"
In function timeZoneAbbreviation...
When date.split('(')[1] is not null, that doesn't mean it is not undefined.
When it is undefined, the script tries to executes ref.slice(0, -1) and the page crashes. This happens in older IE browsers and also Firefox.
There is an error in https://github.com/smalot/bootstrap-datetimepicker/blob/master/js/bootstrap-datetimepicker.js
Example: date = "Tue Apr 18 17:15:13 UTC+0200 2017"
In function timeZoneAbbreviation... When
date.split('(')[1]
is not null, that doesn't mean it is not undefined. When it is undefined, the script tries to executesref.slice(0, -1)
and the page crashes. This happens in older IE browsers and also Firefox.Wrong:
formattedStr = ((ref = date.split('(')[1]) !== null ? ref.slice(0, -1) : 0) || date.split(' ');
Correct:
formattedStr = (((ref = date.split('(')[1]) !== null && (ref = date.split('(')[1]) !== undefined) ? ref.slice(0, -1) : 0) || date.split(' ');