summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/extended
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts/extended')
-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);