rem: MochiKit.DateTime.isoTimestamp = function (str) { /***  Convert an ISO 8601 timestamp (or something close to it) to a Date object.  Will accept the "de facto" form:  YYYY-MM-DD hh:mm:ss  or (the proper form):  YYYY-MM-DDThh:mm:ss  ***/ str = str + ""; if (typeof(str) != "string" || str.length == 0) { return null; } var res = str.match(MochiKit.DateTime._isoRegexp); if (typeof(res) == "undefined" || res == null) { return null; } var year, month, day, hour, min, sec, msec; year = parseInt(res[1], 10); if (typeof(res[2]) == "undefined" || res[2] == "") { return new Date(year); } month = parseInt(res[2], 10) - 1; day = parseInt(res[3], 10); if (typeof(res[4]) == "undefined" || res[4] == "") { return new Date(year, month, day); } hour = parseInt(res[4], 10); min = parseInt(res[5], 10); sec = (typeof(res[6]) != "undefined" && res[6] != "") ? parseInt(res[6], 10) : 0; if (typeof(res[7]) != "undefined" && res[7] != "") { msec = Math.round(1000.0 * parseFloat("0." + res[7])); } else { msec = 0; } if ((typeof(res[8]) == "undefined" || res[8] == "") && (typeof(res[9]) == "undefined" || res[9] == "")) { return new Date(year, month, day, hour, min, sec, msec); } var ofs; if (typeof(res[9]) != "undefined" && res[9] != "") { ofs = parseInt(res[10], 10) * 3600000; if (typeof(res[11]) != "undefined" && res[11] != "") { ofs += parseInt(res[11], 10) * 60000; } if (res[9] == "-") { ofs = -ofs; } } else { ofs = 0; } return new Date(Date.UTC(year, month, day, hour, min, sec, msec) - ofs); 
add: MochiKit.DateTime.isoTimestamp=function(str){ str=str+""; if(typeof (str)!="string"||str.length==0){ return null; } var res=str.match(MochiKit.DateTime._isoRegexp); if(typeof (res)=="undefined"||res==null){ return null; } var year,month,day,hour,min,sec,msec; year=parseInt(res[1],10); if(typeof (res[2])=="undefined"||res[2]==""){ return new Date(year); } month=parseInt(res[2],10)-1; day=parseInt(res[3],10); if(typeof (res[4])=="undefined"||res[4]==""){ return new Date(year,month,day); } hour=parseInt(res[4],10); min=parseInt(res[5],10); sec=(typeof (res[6])!="undefined"&&res[6]!="")?parseInt(res[6],10):0; if(typeof (res[7])!="undefined"&&res[7]!=""){ msec=Math.round(1000*parseFloat("0."+res[7])); }else{ msec=0; } if((typeof (res[8])=="undefined"||res[8]=="")&&(typeof (res[9])=="undefined"||res[9]=="")){ return new Date(year,month,day,hour,min,sec,msec); } var ofs; if(typeof (res[9])!="undefined"&&res[9]!=""){ ofs=parseInt(res[10],10)*3600000; if(typeof (res[11])!="undefined"&&res[11]!=""){ ofs+=parseInt(res[11],10)*60000; } if(res[9]=="-"){ ofs=-ofs; } }else{ ofs=0; } return new Date(Date.UTC(year,month,day,hour,min,sec,msec)-ofs); 
context: MochiKit.DateTime.isoTimestamp = function (str) {    /***        Convert an ISO 8601 timestamp (or something close to it) to        a Date object.  Will accept the "de facto" form:            YYYY-MM-DD hh:mm:ss        or (the proper form):            YYYY-MM-DDThh:mm:ss    ***/    str = str + "";    if (typeof(str) != "string" || str.length == 0) {        return null;    }    var res = str.match(MochiKit.DateTime._isoRegexp);    if (typeof(res) == "undefined" || res == null) {        return null;    }    var year, month, day, hour, min, sec, msec;    year = parseInt(res[1], 10);    if (typeof(res[2]) == "undefined" || res[2] == "") {        return new Date(year);    }    month = parseInt(res[2], 10) - 1;    day = parseInt(res[3], 10);    if (typeof(res[4]) == "undefined" || res[4] == "") {        return new Date(year, month, day);    }    hour = parseInt(res[4], 10);    min = parseInt(res[5], 10);    sec = (typeof(res[6]) != "undefined" && res[6] != "") ? parseInt(res[6], 10) : 0;    if (typeof(res[7]) != "undefined" && res[7] != "") {        msec = Math.round(1000.0 * parseFloat("0." + res[7]));    } else {        msec = 0;    }    if ((typeof(res[8]) == "undefined" || res[8] == "") && (typeof(res[9]) == "undefined" || res[9] == "")) {        return new Date(year, month, day, hour, min, sec, msec);    }    var ofs;    if (typeof(res[9]) != "undefined" && res[9] != "") {        ofs = parseInt(res[10], 10) * 3600000;        if (typeof(res[11]) != "undefined" && res[11] != "") {            ofs += parseInt(res[11], 10) * 60000;        }        if (res[9] == "-") {            ofs = -ofs;        }    } else {        ofs = 0;    }    return new Date(Date.UTC(year, month, day, hour, min, sec, msec) - ofs);};
meta: 8607	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8607/ad067b3f5d648d6df90ec6fb2b79f0027612a307/MochiKit.js/buggy/trunk/lib/MochiKit.js