Allow user to choose which weekdays to display

Closes #1841
This commit is contained in:
Francis Lachapelle
2016-05-06 14:22:52 -04:00
parent 3c6da09ff8
commit c5eeadf041
29 changed files with 393 additions and 146 deletions
@@ -107,6 +107,7 @@
"Day start time" = "Day start time";
"Day end time" = "Day end time";
"Day start time must be prior to day end time." = "Day start time must be prior to day end time.";
"Week days to display" = "Week days to display";
"Show time as busy outside working hours" = "Show time as busy outside working hours";
"First week of year" = "First week of year";
"Enable reminders for Calendar items" = "Enable reminders for Calendar items";
+5
View File
@@ -26,6 +26,8 @@
#import <NGExtensions/NSObject+Logs.h>
#import <SOPE/NGCards/iCalRecurrenceRule.h>
#import <SOGo/NSObject+Utilities.h>
#import <SOGo/NSString+Utilities.h>
#import <SOGo/SOGoUser.h>
@@ -123,6 +125,9 @@ static SoProduct *preferencesProduct = nil;
if (![[defaults source] objectForKey: @"SOGoDayEndTime"])
[[defaults source] setObject: [NSString stringWithFormat: @"%02d:00", [defaults dayEndHour]] forKey: @"SOGoDayEndTime"];
if (![[defaults source] objectForKey: @"SOGoCalendarWeekdays"])
[[defaults source] setObject: [NSArray arrayWithObjects: iCalWeekDayString count: 7] forKey: @"SOGoCalendarWeekdays"];
if (![[defaults source] objectForKey: @"SOGoFirstWeekOfYear"])
[[defaults source] setObject: [defaults firstWeekOfYear] forKey: @"SOGoFirstWeekOfYear"];
+25 -1
View File
@@ -1,6 +1,6 @@
/* UIxPreferences.m - this file is part of SOGo
*
* Copyright (C) 2007-2015 Inverse inc.
* Copyright (C) 2007-2016 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,6 +30,8 @@
#import <NGCards/iCalTimeZone.h>
#import <SOPE/NGCards/iCalRecurrenceRule.h>
#import <SOGo/NSArray+Utilities.h>
#import <SOGo/NSDictionary+Utilities.h>
#import <SOGo/NSString+Utilities.h>
@@ -721,6 +723,28 @@ static NSArray *reminderValues = nil;
// return [[moduleSettings objectForKey: @"PreventInvitations"] boolValue];
// }
- (NSArray *) shortWeekDaysList
{
static NSArray *shortWeekDaysList = nil;
if (!shortWeekDaysList)
{
shortWeekDaysList = [locale objectForKey: NSShortWeekDayNameArray];
[shortWeekDaysList retain];
}
return shortWeekDaysList;
}
- (NSString *) valueForWeekDay
{
unsigned int i;
i = [[self shortWeekDaysList] indexOfObject: item];
return iCalWeekDayString[i];
}
//
// Used by wox template
//