Revision: 9000
http://xoops.svn.sourceforge.net/xoops/?rev=9000&view=rev
Author: forxoops
Date: 2012-02-15 15:41:59 +0000 (Wed, 15 Feb 2012)
Log Message:
-----------
Fix date problem with some old module
Fix an error during install process for template
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.5/htdocs/include/calendar.js
Modified: XoopsCore/branches/2.5.x/2.5.5/htdocs/include/calendar.js
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/htdocs/include/calendar.js 2012-02-15 14:01:16 UTC (rev 8999)
+++ XoopsCore/branches/2.5.x/2.5.5/htdocs/include/calendar.js 2012-02-15 15:41:59 UTC (rev 9000)
@@ -453,7 +453,7 @@
if (el.ttip.substr(0, 1) == "_") {
var date = null;
with (el.calendar.date) {
- date = new Date(getFullYear(), getMonth(), el.caldate);
+ date = new Date(getFullYear(), getMonthFormatted(), el.caldate);
}
el.ttip = date.print(el.calendar.ttDateFormat) + el.ttip.substr(1);
}
@@ -1230,7 +1230,7 @@
Date.prototype.getMonthDays = function(month) {
var year = this.getFullYear();
if (typeof month == "undefined") {
- month = this.getMonth();
+ month = this.getMonthFormatted();
}
if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
return 29;
@@ -1260,13 +1260,13 @@
/** Prints the date in a string according to the given format. */
Date.prototype.print = function (frm) {
var str = new String(frm);
- var m = this.getMonth();
+ var m = this.getMonthFormatted();
var d = this.getDate();
var y = this.getFullYear();
var s = new Array();
s["j"] = d;
s["d"] = (d < 10) ? ("0" + d) : d;
- s["m"] = 1+m;
+ s["m"] = m;
s["n"] = (m < 9) ? ("0" + (1+m)) : (1+m);
s["Y"] = y;
s["y"] = new String(y).substr(2, 2);
@@ -1278,6 +1278,12 @@
return str;
};
+Date.prototype.getMonthFormatted = function() {
+ var month = this.getMonth() + 1;
+ return month < 10 ? '0' + month : month; // ('' + month) for string result
+}
+
+
// END: DATE OBJECT PATCHES
// global object that remembers the calendar
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|