Calendar descriptions (iCal export) (#417)

* controllers CalendarApiController: setDescription for events

* services CalendarService: include link to mealplan in calendar descriptions
This commit is contained in:
kriddles 2019-10-12 03:16:06 -05:00 committed by Bernd Bestel
parent 744fd03633
commit c6ae8cc348
2 changed files with 3 additions and 1 deletions

View File

@ -38,6 +38,7 @@ class CalendarApiController extends BaseApiController
$vEvent->setDtStart($date)
->setDtEnd($date)
->setSummary($event['title'])
->setDescription($event['description'])
->setNoTime($event['date_format'] === 'date')
->setUseTimezone(true);

View File

@ -99,7 +99,8 @@ class CalendarService extends BaseService
$mealPlanRecipeEvents[] = array(
'title' => $titlePrefix . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->includes_recipe_id)->name,
'start' => FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->recipe_id)->name,
'date_format' => 'date'
'date_format' => 'date',
'description' => GROCY_BASE_URL . '/mealplan' . '?week=' . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->recipe_id)->name
);
}
}