Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/tasks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorraimund-schluessler <raimund.schluessler@googlemail.com>2014-05-13 22:05:30 +0400
committerraimund-schluessler <raimund.schluessler@googlemail.com>2014-05-13 22:05:30 +0400
commit62472e1662239d1b21daf31d86abc59ecca30853 (patch)
tree0ced68d484da19e75cac44ce4a02564f866db3a9 /lib
parentd557b2269307e3eb21ad617af837328a6aad7599 (diff)
Add support for oC 6.0.1
Diffstat (limited to 'lib')
-rw-r--r--lib/helper.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/helper.php b/lib/helper.php
index 016d6bf0..23f96246 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -72,6 +72,8 @@ Class helper {
$reminderType = $reminder->TRIGGER['VALUE']->value;
$reminderAction = $reminder->ACTION->value;
+ $reminderDate = null;
+ $reminderDuration = null;
if($reminderType == 'DATE-TIME'){
@@ -82,10 +84,14 @@ Class helper {
$parsed = VObject\DateTimeParser::parseDuration($reminder->TRIGGER,true);
// Calculate the reminder date from duration and start date
- if($reminder->TRIGGER['RELATED']->value == 'END' && $due){
- $reminderDate = $due->modify($parsed)->format('Ymd\THis');
- } elseif ($start) {
- $reminderDate = $start->modify($parsed)->format('Ymd\THis');
+ $related = null;
+ if(is_object($reminder->TRIGGER['RELATED'])){
+ $related = $reminder->TRIGGER['RELATED']->value;
+ if(is_object($reminder->TRIGGER['RELATED']) && $reminder->TRIGGER['RELATED']->value == 'END' && $due){
+ $reminderDate = $due->modify($parsed)->format('Ymd\THis');
+ } elseif ($start) {
+ $reminderDate = $start->modify($parsed)->format('Ymd\THis');
+ }
} else{
throw new \Exception('Reminder duration related to not available date.');
}
@@ -118,8 +124,8 @@ Class helper {
}
$reminderDuration['params'] = array(
- 'id' => (int)$invert.(int)($reminder->TRIGGER['RELATED']->value == 'END'),
- 'related'=> $reminder->TRIGGER['RELATED']->value?$reminder->TRIGGER['RELATED']->value:'START',
+ 'id' => (int)$invert.(int)($related == 'END'),
+ 'related'=> $related?$related:'START',
'invert'=> $invert
);