From 9275bf0de0e9ccbc5ee9311c9b59efcbfbc01a6a Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 19 Jan 2006 07:42:52 +0000 Subject: --- framework/Web/Javascripts/extended/date.js | 8 ++++---- framework/Web/Javascripts/extended/string.js | 5 +---- framework/Web/Javascripts/extended/util.js | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'framework/Web/Javascripts/extended') 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