From de282bc4d51ebb6902415ed30443b6fd425d4073 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 15 Jun 2007 13:36:23 +0000 Subject: [PATCH] the splitting with a complex regex for the parseDate does not work with old javascript. reworked it so splitting is done possible (date) delimiter by delimiter --- phpgwapi/js/jscalendar/calendar.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/phpgwapi/js/jscalendar/calendar.js b/phpgwapi/js/jscalendar/calendar.js index ccdcb58e55..2077bf90b6 100644 --- a/phpgwapi/js/jscalendar/calendar.js +++ b/phpgwapi/js/jscalendar/calendar.js @@ -1441,9 +1441,18 @@ Calendar.prototype.parseDate = function (str, fmt) { var m = -1; var d = 0; // var a = str.split(/\W+/); does not work with multibyte chars, eg. german umlauts under utf-8 - var a = str.split(/[./-]/); +// var a = str.split(/[./-]/); does not work with old javascript + var a; + a=str.split(/\//); + if (a[0]==str) { + a=str.split(/-/); + } + if (a[0]==str) { + a=str.split(/\./); + } + if (!fmt) { - fmt = this.dateFormat; + fmt = this.dateFormat; } var b = fmt.match(/%./g); var i = 0, j = 0;