projects
/
roojs1
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
roojs-ui.js
[roojs1]
/
Date.js
diff --git
a/Date.js
b/Date.js
index
95b13e0
..
6f217a5
100644
(file)
--- a/
Date.js
+++ b/
Date.js
@@
-261,6
+261,7
@@
Date.parseDate = function(input, format) {
/**
* @private
*/
/**
* @private
*/
+
Date.createParser = function(format) {
var funcName = "parse" + Date.parseFunctions.count++;
var regexNum = Date.parseRegexes.length;
Date.createParser = function(format) {
var funcName = "parse" + Date.parseFunctions.count++;
var regexNum = Date.parseRegexes.length;
@@
-269,13
+270,11
@@
Date.createParser = function(format) {
var code = "Date." + funcName + " = function(input){\n"
+ "var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, o, z, v;\n"
var code = "Date." + funcName + " = function(input){\n"
+ "var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, o, z, v;\n"
- + "Roo.log(input);\n"
- + "Roo.log(regexNum);\n"
- + "Roo.log(typeof(input));\n"
+ "var d = new Date();\n"
+ "y = d.getFullYear();\n"
+ "m = d.getMonth();\n"
+ "d = d.getDate();\n"
+ "var d = new Date();\n"
+ "y = d.getFullYear();\n"
+ "m = d.getMonth();\n"
+ "d = d.getDate();\n"
+ + "if (typeof(input) !== 'string') { input = input.toString(); }\n"
+ "var results = input.match(Date.parseRegexes[" + regexNum + "]);\n"
+ "if (results && results.length > 0) {";
var regex = "";
+ "var results = input.match(Date.parseRegexes[" + regexNum + "]);\n"
+ "if (results && results.length > 0) {";
var regex = "";
@@
-705,8
+704,8
@@
Date.prototype.clearTime = function(clone){
};
// private
};
// 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.brokenSetMonth = Date.prototype.setMonth;
Date.prototype.setMonth = function(num){
if(num <= -1){
@@
-776,7
+775,7
@@
document.write(dt3); //returns 'Fri Oct 06 2006 07:30:00'
*/
Date.prototype.add = function(interval, value){
var d = this.clone();
*/
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);
switch(interval.toLowerCase()){
case Date.MILLI:
d.setMilliseconds(this.getMilliseconds() + value);