Allow user to choose which weekdays to display

Closes #1841
This commit is contained in:
Francis Lachapelle
2016-05-06 14:14:45 -04:00
parent 3c6da09ff8
commit c5eeadf041
29 changed files with 393 additions and 146 deletions
@@ -123,6 +123,17 @@
url += view[1];
else
url += 'week';
// Append today's date or next enabled weekday
var now = new Date();
if (Preferences.defaults.SOGoCalendarWeekdays) {
var weekDays = ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'];
var weekDay = weekDays[now.getDay()];
while (Preferences.defaults.SOGoCalendarWeekdays.indexOf(weekDay) < 0) {
now.addDays(1);
weekDay = weekDays[now.getDay()];
}
}
url += '/' + now.getDayString();
$location.replace().url(url);
});
}