summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts')
-rw-r--r--framework/Web/Javascripts/extended/date.js8
-rw-r--r--framework/Web/Javascripts/extended/string.js5
-rw-r--r--framework/Web/Javascripts/extended/util.js2
3 files changed, 6 insertions, 9 deletions
diff --git a/framework/Web/Javascripts/extended/date.js b/framework/Web/Javascripts/extended/date.js
index 375c59df..9e56ff64 100644
--- a/framework/Web/Javascripts/extended/date.js
+++ b/framework/Web/Javascripts/extended/date.js
@@ -5,10 +5,10 @@ Object.extend(Date.prototype,
{
var bits = new Array();
bits['d'] = this.getDate();
- bits['dd'] = Prado.Util.pad(this.getDate(),2);
+ bits['dd'] = String(this.getDate()).zerofill(2);
bits['M'] = this.getMonth()+1;
- bits['MM'] = Prado.Util.pad(this.getMonth()+1,2);
+ bits['MM'] = String(this.getMonth()+1).zerofill(2);
var yearStr = "" + this.getFullYear();
yearStr = (yearStr.length == 2) ? '19' + yearStr: yearStr;
@@ -29,8 +29,8 @@ Object.extend(Date.prototype,
toISODate : function()
{
var y = this.getFullYear();
- var m = Prado.Util.pad(this.getMonth() + 1);
- var d = Prado.Util.pad(this.getDate());
+ var m = String(this.getMonth() + 1).zerofill(2);
+ var d = String(this.getDate()).zerofill(2);
return String(y) + String(m) + String(d);
}
});
diff --git a/framework/Web/Javascripts/extended/string.js b/framework/Web/Javascripts/extended/string.js
index 9b4c501b..e265edf4 100644
--- a/framework/Web/Javascripts/extended/string.js
+++ b/framework/Web/Javascripts/extended/string.js
@@ -16,10 +16,7 @@ Object.extend(String.prototype, {
},
zerofill : function(len) {
- var s = this;
- var ix = /^[+-]/.test(s) ? 1 : 0;
- while (s.length<len) s = s.insert(ix, '0');
- return s;
+ return this.padLeft(len,'0');
},
trim : function() {
diff --git a/framework/Web/Javascripts/extended/util.js b/framework/Web/Javascripts/extended/util.js
index 73a27992..47d620b0 100644
--- a/framework/Web/Javascripts/extended/util.js
+++ b/framework/Web/Javascripts/extended/util.js
@@ -86,6 +86,6 @@ function isElement(o, strict) {
/**
* true if o is an Array or a NodeList, (NodeList in Opera returns a type of function)
*/
-function isList(o) { return o && isObject(o) && (isArray(o) || o.item) }
+function isList(o) { return o && isObject(o) && (isArray(o) || (o.item && o.tagName.toLowerCase() != "select")) }