diff --git a/services/CalendarService.php b/services/CalendarService.php index 0af223d1..e951cb91 100644 --- a/services/CalendarService.php +++ b/services/CalendarService.php @@ -7,6 +7,7 @@ use \Grocy\Services\TasksService; use \Grocy\Services\ChoresService; use \Grocy\Services\BatteriesService; use \Grocy\Services\UsersService; +use \Grocy\Helpers\UrlManager; class CalendarService extends BaseService { @@ -17,12 +18,14 @@ class CalendarService extends BaseService $this->TasksService = new TasksService(); $this->ChoresService = new ChoresService(); $this->BatteriesService = new BatteriesService(); + $this->UrlManager = new UrlManager(GROCY_BASE_URL); } protected $StockService; protected $TasksService; protected $ChoresService; protected $BatteriesService; + protected $UrlManager; public function GetEvents() { @@ -100,7 +103,7 @@ class CalendarService extends BaseService 'title' => $titlePrefix . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->includes_recipe_id)->name, 'start' => FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->recipe_id)->name, 'date_format' => 'date', - 'description' => GROCY_BASE_URL . '/mealplan' . '?week=' . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->recipe_id)->name + 'description' => $this->UrlManager->ConstructUrl('/mealplan' . '?week=' . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->recipe_id)->name) ); } }