make it possible to set saturday as first day of the week

master
Georg Ehrke 2013-09-12 10:33:15 +02:00
parent e896444103
commit 6c1a29b232
2 changed files with 34 additions and 1 deletions

View File

@ -38,6 +38,38 @@ $eventSources[] = array('url' => $events_baseURL.'?calendar_id=shared_events',
OCP\Util::emitHook('OC_Calendar', 'getSources', array('sources' => &$eventSources));
$firstDay = null;
$firstDayConfig = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'firstday', 'mo');
switch($firstDayConfig) {
case 'su':
$firstDay = 0;
break;
case 'tu':
$firstDay = 2;
break;
case 'we':
$firstDay = 3;
break;
case 'th':
$firstDay = 4;
break;
case 'fr':
$firstDay = 5;
break;
case 'sa':
$firstDay = 6;
break;
default:
$firstDay = 1;
break;
}
$array = array(
"defaultView" => "\"".OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month')."\"",
"eventSources" => json_encode($eventSources),
@ -60,7 +92,7 @@ $array = array(
"missing_field_startsbeforeends" => "\"".addslashes($l->t('The event ends before it starts'))."\"",
"missing_field_dberror" => "\"".addslashes($l->t('There was a database fail'))."\"",
"totalurl" => "\"".OCP\Util::linkToRemote('caldav')."calendars"."\"",
"firstDay" => (OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'firstday', 'mo') == 'mo' ? '1' : '0'),
"firstDay" => $firstDay,
);
// Echo it

View File

@ -67,6 +67,7 @@
<select style="display: none;" id="firstday" title="<?php p("First day"); ?>" name="firstday">
<option value="mo" id="mo"><?php p($l->t("Monday")); ?></option>
<option value="su" id="su"><?php p($l->t("Sunday")); ?></option>
<option value="sa" id="sa"><?php p($l->t("Saturday")); ?></option>
</select>
</td>
</tr>