mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-16 17:05:25 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user