aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-14 21:44:27 -0700
committerFriendika <info@friendika.com>2011-06-14 21:44:27 -0700
commitcee63c7a0d5362e255551d0a8c3dfa667322f8b1 (patch)
tree02eb18440555ea1b06e4b8274417392d769bc428 /mod
parentc3797743006bce467ad3595a7847755a3f678347 (diff)
downloadvolse-hubzilla-cee63c7a0d5362e255551d0a8c3dfa667322f8b1.tar.gz
volse-hubzilla-cee63c7a0d5362e255551d0a8c3dfa667322f8b1.tar.bz2
volse-hubzilla-cee63c7a0d5362e255551d0a8c3dfa667322f8b1.zip
preserve original timezone adjust selection when editing events
Diffstat (limited to 'mod')
-rw-r--r--mod/events.php24
1 files changed, 14 insertions, 10 deletions
diff --git a/mod/events.php b/mod/events.php
index b900eb29d..07231eb05 100644
--- a/mod/events.php
+++ b/mod/events.php
@@ -267,19 +267,23 @@ dbg(0);
$sdt = ((x($orig_event)) ? $orig_event['start'] : 'now');
$fdt = ((x($orig_event)) ? $orig_event['finish'] : 'now');
- $syear = datetime_convert('UTC', date_default_timezone_get(), $sdt, 'Y');
- $smonth = datetime_convert('UTC', date_default_timezone_get(), $sdt, 'm');
- $sday = datetime_convert('UTC', date_default_timezone_get(), $sdt, 'd');
+ $tz = ((x($orig_event) && $orig_event['adjust']) ? date_default_timezone_get() : 'UTC');
+
- $shour = ((x($orig_event)) ? datetime_convert('UTC', date_default_timezone_get(), $sdt, 'H') : 0);
- $sminute = ((x($orig_event)) ? datetime_convert('UTC', date_default_timezone_get(), $sdt, 'i') : 0);
- $fyear = datetime_convert('UTC', date_default_timezone_get(), $fdt, 'Y');
- $fmonth = datetime_convert('UTC', date_default_timezone_get(), $fdt, 'm');
- $fday = datetime_convert('UTC', date_default_timezone_get(), $fdt, 'd');
+ $syear = datetime_convert('UTC', $tz, $sdt, 'Y');
+ $smonth = datetime_convert('UTC', $tz, $sdt, 'm');
+ $sday = datetime_convert('UTC', $tz, $sdt, 'd');
- $fhour = ((x($orig_event)) ? datetime_convert('UTC', date_default_timezone_get(), $fdt, 'H') : 0);
- $fminute = ((x($orig_event)) ? datetime_convert('UTC', date_default_timezone_get(), $fdt, 'i') : 0);
+ $shour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'H') : 0);
+ $sminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'i') : 0);
+
+ $fyear = datetime_convert('UTC', $tz, $fdt, 'Y');
+ $fmonth = datetime_convert('UTC', $tz, $fdt, 'm');
+ $fday = datetime_convert('UTC', $tz, $fdt, 'd');
+
+ $fhour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'H') : 0);
+ $fminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'i') : 0);
require_once('include/acl_selectors.php');