Monotone-Parent: b71cb031b6d81c362bbb5a411baf4cd30bcf1b01

Monotone-Revision: f0e01017c45580ffb00a3ec0ea376689e815bd26

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-11-07T16:13:03
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-11-07 16:13:03 +00:00
parent 53d90d404c
commit 0885f51b6f
10 changed files with 221 additions and 25 deletions
@@ -17,6 +17,19 @@ String.prototype.decodeEntities = function() {
});
}
String.prototype.asDate = function () {
var newDate;
var date = this.split("/");
if (date.length == 3)
newDate = new Date(date[2], date[1] - 1, date[0]);
else {
date = this.split("-");
newDate = new Date(date[0], date[1] - 1, date[2]);
}
return newDate;
}
Date.prototype.sogoDayName = function() {
var dayName = "";
@@ -55,12 +68,22 @@ Date.prototype.daysUpTo = function(otherDate) {
return days;
}
Date.prototype.sogoFreeBusyStringWithSeparator = function(separator) {
var str = this.sogoDayName() + ", ";
Date.prototype.stringWithSeparator = function(separator) {
var month = '' + (this.getMonth() + 1);
var day = '' + this.getDate();
if (month.length == 1)
month = '0' + month;
if (day.length == 1)
day = '0' + day;
if (separator == '-')
str += (this.getYear() + 1900) + '-' + (this.getMonth() + 1) + '-' + this.getDate();
str = (this.getYear() + 1900) + '-' + month + '-' + day;
else
str += this.getDate() + '/' + (this.getMonth() + 1) + '/' + (this.getYear() + 1900);
str = day + '/' + month + '/' + (this.getYear() + 1900);
return str;
}
Date.prototype.sogoFreeBusyStringWithSeparator = function(separator) {
return this.sogoDayName() + ", " + this.stringWithSeparator(separator);
}