diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php index 7b6013019..96b3438dc 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php @@ -48,8 +48,10 @@ class AccompanyingCourseWorkApiController extends ApiController */ public function myWorksNearEndDate(Request $request): JsonResponse { - $since = (new \DateTimeImmutable('now'))->sub(new \DateInterval('P15D')); - $until = (new \DateTimeImmutable('now'))->add(new \DateInterval('P15D')); + $since = (new \DateTimeImmutable('now')) + ->sub(new \DateInterval('P'.$request->query->getInt('since', 15).'D')); + $until = (new \DateTimeImmutable('now')) + ->add(new \DateInterval('P'.$request->query->getInt('since', 15).'D')); $total = $this->accompanyingPeriodWorkRepository ->countNearEndDateByUser($this->getUser(), $since, $until); $paginator = $this->getPaginatorFactory()->create($total);