/**
* @private
*/
+
Date.createParser = function(format) {
var funcName = "parse" + Date.parseFunctions.count++;
var regexNum = Date.parseRegexes.length;
Date.parseFunctions[format] = funcName;
var code = "Date." + funcName + " = function(input){\n"
- + "Roo.log(input) \n"
+ "var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, o, z, v;\n"
+ "var d = new Date();\n"
+ "y = d.getFullYear();\n"
};
// private
-// safari setMonth is broken
-if(Roo.isSafari){
+// safari setMonth is broken -- check that this is only donw once...
+if(Roo.isSafari && typeof(Date.brokenSetMonth) == 'undefined'){
Date.brokenSetMonth = Date.prototype.setMonth;
Date.prototype.setMonth = function(num){
if(num <= -1){
*/
Date.prototype.add = function(interval, value){
var d = this.clone();
- if (!interval || value === 0) return d;
+ if (!interval || value === 0) { return d; }
switch(interval.toLowerCase()){
case Date.MILLI:
d.setMilliseconds(this.getMilliseconds() + value);