Fix possible javascript error in parseISO8601() (#5175)

This commit is contained in:
Aleksander Machniak 2015-08-05 12:46:05 +02:00
parent 90ad98cda7
commit 95b98257b1

View file

@ -123,6 +123,11 @@ function rcube_libcalendaring(settings)
*/ */
this.parseISO8601 = function(s) this.parseISO8601 = function(s)
{ {
// already a Date object?
if (s && s.getMonth) {
return s;
}
// force d to be on check's YMD, for daylight savings purposes // force d to be on check's YMD, for daylight savings purposes
var fixDate = function(d, check) { var fixDate = function(d, check) {
if (+d) { // prevent infinite looping on invalid dates if (+d) { // prevent infinite looping on invalid dates