mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-29 11:23:54 +01:00
patch from Christian
this patch fixes the handling of daylight saving
This commit is contained in:
parent
e43fddbcee
commit
a57b53e713
@ -915,8 +915,8 @@ class Horde_iCalendar {
|
|||||||
{
|
{
|
||||||
$temp = array();
|
$temp = array();
|
||||||
if (!is_object($value) || is_array($value)) {
|
if (!is_object($value) || is_array($value)) {
|
||||||
$TZOffset = 3600 * substr(date('O'), 0, 3);
|
$TZOffset = 3600 * substr(date('O',$value), 0, 3);
|
||||||
$TZOffset += 60 * substr(date('O'), 3, 2);
|
$TZOffset += 60 * substr(date('O',$value), 3, 2);
|
||||||
$value -= $TZOffset;
|
$value -= $TZOffset;
|
||||||
|
|
||||||
$temp['zone'] = 'UTC';
|
$temp['zone'] = 'UTC';
|
||||||
@ -929,13 +929,15 @@ class Horde_iCalendar {
|
|||||||
} else {
|
} else {
|
||||||
$dateOb = (object)$value;
|
$dateOb = (object)$value;
|
||||||
|
|
||||||
|
$TZOffset = date('O',mktime($dateOb->hour,$dateOb->min,$dateOb->sec,$dateOb->month,$dateOb->mday,$dateOb->year));
|
||||||
|
|
||||||
// Minutes.
|
// Minutes.
|
||||||
$TZOffset = substr(date('O'), 3, 2);
|
$TZOffsetMin = substr($TZOffset, 0, 1) . substr($TZOffset, 3, 2);
|
||||||
$thisMin = $dateOb->min - $TZOffset;
|
$thisMin = $dateOb->min - $TZOffsetMin;
|
||||||
|
|
||||||
// Hours.
|
// Hours.
|
||||||
$TZOffset = substr(date('O'), 0, 3);
|
$TZOffsetHour = substr($TZOffset, 0, 3);
|
||||||
$thisHour = $dateOb->hour - $TZOffset;
|
$thisHour = $dateOb->hour - $TZOffsetHour;
|
||||||
|
|
||||||
if ($thisMin < 0) {
|
if ($thisMin < 0) {
|
||||||
$thisHour -= 1;
|
$thisHour -= 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user