summaryrefslogtreecommitdiffstats
path: root/apps/calendar/lib/app.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-07-21 00:45:13 +0200
committerBart Visscher <bartv@thisnet.nl>2012-07-21 00:45:30 +0200
commit060b8865a4701cfe400e424765031c219330fa1a (patch)
tree3a0ac9c0e2f370f1fbcb0d584733b280651413ee /apps/calendar/lib/app.php
parent1c30a97833235e585528da288d20663f65ac25b3 (diff)
downloadnextcloud-server-060b8865a4701cfe400e424765031c219330fa1a.tar.gz
nextcloud-server-060b8865a4701cfe400e424765031c219330fa1a.zip
DRY for getting calendar timezone setting
Diffstat (limited to 'apps/calendar/lib/app.php')
-rw-r--r--apps/calendar/lib/app.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/calendar/lib/app.php b/apps/calendar/lib/app.php
index 1a13f2958c0..29e5ab5b0c8 100644
--- a/apps/calendar/lib/app.php
+++ b/apps/calendar/lib/app.php
@@ -9,7 +9,7 @@
* This class manages our app actions
*/
OC_Calendar_App::$l10n = new OC_L10N('calendar');
-OC_Calendar_App::$tz = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezone', date_default_timezone_get());
+OC_Calendar_App::$tz = OC_Calendar_App::getTimezone();
class OC_Calendar_App{
const CALENDAR = 'calendar';
const EVENT = 'event';
@@ -282,7 +282,17 @@ class OC_Calendar_App{
public static function getWeekofMonth(){
return OC_Calendar_Object::getWeekofMonth(self::$l10n);
}
-
+
+ /**
+ * @return (string) $timezone as set by user or the default timezone
+ */
+ public static function getTimezone() {
+ return OCP\Config::getUserValue(OCP\User::getUser(),
+ 'calendar',
+ 'timezone',
+ date_default_timezone_get());
+ }
+
/**
* @brief checks the access for a calendar / an event
* @param (int) $id - id of the calendar / event