mirror of
https://framagit.org/framasoft/framadate/framadate
synced 2026-01-23 02:14:06 +00:00
Merge branch 'ical-timerange' into 'develop'
ICalService: Support start_time-end_time time specs See merge request framasoft/framadate/framadate!481
This commit is contained in:
commit
fc9ab858c0
1 changed files with 14 additions and 1 deletions
|
|
@ -60,9 +60,22 @@ class ICalService {
|
|||
}
|
||||
|
||||
$ical_text = "";
|
||||
$elements = explode("-", $start_time);
|
||||
$end_time = null;
|
||||
if(count($elements) === 2) {
|
||||
$start_time = trim($elements[0]);
|
||||
$end_time = trim($elements[1]);
|
||||
}
|
||||
$start_time = $this->reviseTimeString($start_time);
|
||||
if($end_time !== null) {
|
||||
$end_time = $this->reviseTimeString($end_time);
|
||||
}
|
||||
if($start_time !== null) {
|
||||
$ical_text = $this->getTimedEvent1Hour($poll, $start_day . " " . $start_time);
|
||||
if($end_time !== null) {
|
||||
$ical_text = $this->getTimedEvent($poll, $start_day . " " . $start_time, $start_day . " " . $end_time);
|
||||
} else {
|
||||
$ical_text = $this->getTimedEvent1Hour($poll, $start_day . " " . $start_time);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$date = DateTime::createFromFormat('d-m-Y', $start_day);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue