(feat) now possible to set vacation message start date (fixes #3679)

This commit is contained in:
Ludovic Marcotte
2016-06-13 15:39:57 -04:00
parent 91bd493b82
commit a3d64d05f6
7 changed files with 82 additions and 30 deletions

View File

@@ -39,6 +39,12 @@
// We also convert our date objects into real date, otherwise we'll have strings
// or undefined values and the md-datepicker does NOT like this.
if (data.Vacation) {
if (data.Vacation.startDate)
data.Vacation.startDate = new Date(parseInt(data.Vacation.startDate) * 1000);
else {
data.Vacation.startDateEnabled = 0;
data.Vacation.startDate = new Date();
}
if (data.Vacation.endDate)
data.Vacation.endDate = new Date(parseInt(data.Vacation.endDate) * 1000);
else {
@@ -59,6 +65,11 @@
if (angular.isUndefined(data.Vacation.daysBetweenResponse))
data.Vacation.daysBetweenResponse = 7;
if (angular.isUndefined(data.Vacation.startDate)) {
data.Vacation.startDateEnabled = 0;
data.Vacation.startDate = new Date();
}
if (angular.isUndefined(data.Vacation.endDate)) {
data.Vacation.endDateEnabled = 0;
data.Vacation.endDate = new Date();
@@ -218,6 +229,10 @@
delete preferences.defaults.SOGoMailComposeFontSizeEnabled;
if (preferences.defaults.Vacation) {
if (preferences.defaults.Vacation.startDateEnabled)
preferences.defaults.Vacation.startDate = preferences.defaults.Vacation.startDate.getTime()/1000;
else
preferences.defaults.Vacation.startDate = 0;
if (preferences.defaults.Vacation.endDateEnabled)
preferences.defaults.Vacation.endDate = preferences.defaults.Vacation.endDate.getTime()/1000;
else