summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/extended/date.js
diff options
context:
space:
mode:
authorwei <>2006-01-20 07:02:43 +0000
committerwei <>2006-01-20 07:02:43 +0000
commita48195e52865532add00af44788c938071eb0e1d (patch)
treec3d3bd95cfb09c7e4b45fe6363874bef8397d7ce /framework/Web/Javascripts/extended/date.js
parent138dbc23381a82eaf17a2685cc3bdb54ad8b7f51 (diff)
Update date picker
Diffstat (limited to 'framework/Web/Javascripts/extended/date.js')
-rw-r--r--framework/Web/Javascripts/extended/date.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/framework/Web/Javascripts/extended/date.js b/framework/Web/Javascripts/extended/date.js
index 9e56ff64..b27f9da2 100644
--- a/framework/Web/Javascripts/extended/date.js
+++ b/framework/Web/Javascripts/extended/date.js
@@ -1,20 +1,24 @@
Object.extend(Date.prototype,
{
- SimpleFormat: function(format)
+ SimpleFormat: function(format, data)
{
+ data = data || {};
var bits = new Array();
bits['d'] = this.getDate();
bits['dd'] = String(this.getDate()).zerofill(2);
bits['M'] = this.getMonth()+1;
bits['MM'] = String(this.getMonth()+1).zerofill(2);
-
+ if(data.AbbreviatedMonthNames)
+ bits['MMM'] = data.AbbreviatedMonthNames[this.getMonth()];
+ if(data.MonthNames)
+ bits['MMMM'] = data.MonthNames[this.getMonth()];
var yearStr = "" + this.getFullYear();
yearStr = (yearStr.length == 2) ? '19' + yearStr: yearStr;
bits['yyyy'] = yearStr;
bits['yy'] = bits['yyyy'].toString().substr(2,2);
-
+
// do some funky regexs to replace the format string
// with the real values
var frm = new String(format);