diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-11-25 15:05:21 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-11-25 15:05:21 +0100 |
commit | fe57e7059bc6ef1942a6b054a4da8edfb5a07578 (patch) | |
tree | f4a73b035a07e2ab87ba9d6b19f180b66106bf5b /mod/events.php | |
parent | 0559db9cf81267c34ca014fef1aebe1cf31de2ab (diff) | |
download | volse-hubzilla-fe57e7059bc6ef1942a6b054a4da8edfb5a07578.tar.gz volse-hubzilla-fe57e7059bc6ef1942a6b054a4da8edfb5a07578.tar.bz2 volse-hubzilla-fe57e7059bc6ef1942a6b054a4da8edfb5a07578.zip |
events: make sure default finish date is one hour after start date and shift the finishdate if startdate is shifted
Diffstat (limited to 'mod/events.php')
-rwxr-xr-x | mod/events.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/mod/events.php b/mod/events.php index d55d22f44..0366c9b02 100755 --- a/mod/events.php +++ b/mod/events.php @@ -366,7 +366,7 @@ function events_content(&$a) { $sdt = ((x($orig_event)) ? $orig_event['start'] : 'now'); - $fdt = ((x($orig_event)) ? $orig_event['finish'] : 'now'); + $fdt = ((x($orig_event)) ? $orig_event['finish'] : '+1 hour'); $tz = date_default_timezone_get(); if(x($orig_event)) @@ -380,8 +380,12 @@ function events_content(&$a) { $smonth = datetime_convert('UTC', $tz, $sdt, 'm'); $sday = datetime_convert('UTC', $tz, $sdt, 'd'); - $shour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'H') : '00'); - $sminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'i') : '00'); +// $shour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'H') : '00'); +// $sminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'i') : '00'); + + $shour = datetime_convert('UTC', $tz, $sdt, 'H'); + $sminute = datetime_convert('UTC', $tz, $sdt, 'i'); + $stext = datetime_convert('UTC',$tz,$sdt); $stext = substr($stext,0,14) . "00:00"; @@ -393,8 +397,12 @@ function events_content(&$a) { $fmonth = datetime_convert('UTC', $tz, $fdt, 'm'); $fday = datetime_convert('UTC', $tz, $fdt, 'd'); - $fhour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'H') : '00'); - $fminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'i') : '00'); +// $fhour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'H') : '00'); +// $fminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'i') : '00'); + + $fhour = datetime_convert('UTC', $tz, $fdt, 'H'); + $fminute = datetime_convert('UTC', $tz, $fdt, 'i'); + $ftext = datetime_convert('UTC',$tz,$fdt); $ftext = substr($ftext,0,14) . "00:00"; $type = ((x($orig_event)) ? $orig_event['type'] : 'event'); |