preserve original timezone adjust selection when editing events
This commit is contained in:
parent
c379774300
commit
cee63c7a0d
2 changed files with 17 additions and 10 deletions
|
@ -176,6 +176,9 @@ function ev_compare($a,$b) {
|
||||||
$date_a = (($a['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$a['start']) : $a['start']);
|
$date_a = (($a['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$a['start']) : $a['start']);
|
||||||
$date_b = (($b['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$b['start']) : $b['start']);
|
$date_b = (($b['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$b['start']) : $b['start']);
|
||||||
|
|
||||||
|
if($date_a === $date_b)
|
||||||
|
return strcasecmp($a['desc'],$b['desc']);
|
||||||
|
|
||||||
return strcmp($date_a,$date_b);
|
return strcmp($date_a,$date_b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -267,19 +267,23 @@ dbg(0);
|
||||||
$sdt = ((x($orig_event)) ? $orig_event['start'] : 'now');
|
$sdt = ((x($orig_event)) ? $orig_event['start'] : 'now');
|
||||||
$fdt = ((x($orig_event)) ? $orig_event['finish'] : 'now');
|
$fdt = ((x($orig_event)) ? $orig_event['finish'] : 'now');
|
||||||
|
|
||||||
$syear = datetime_convert('UTC', date_default_timezone_get(), $sdt, 'Y');
|
$tz = ((x($orig_event) && $orig_event['adjust']) ? date_default_timezone_get() : 'UTC');
|
||||||
$smonth = datetime_convert('UTC', date_default_timezone_get(), $sdt, 'm');
|
|
||||||
$sday = datetime_convert('UTC', date_default_timezone_get(), $sdt, 'd');
|
|
||||||
|
|
||||||
$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');
|
|
||||||
|
|
||||||
$fhour = ((x($orig_event)) ? datetime_convert('UTC', date_default_timezone_get(), $fdt, 'H') : 0);
|
$syear = datetime_convert('UTC', $tz, $sdt, 'Y');
|
||||||
$fminute = ((x($orig_event)) ? datetime_convert('UTC', date_default_timezone_get(), $fdt, 'i') : 0);
|
$smonth = datetime_convert('UTC', $tz, $sdt, 'm');
|
||||||
|
$sday = datetime_convert('UTC', $tz, $sdt, 'd');
|
||||||
|
|
||||||
|
$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');
|
require_once('include/acl_selectors.php');
|
||||||
|
|
Loading…
Reference in a new issue