Newer
Older
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class HomeController extends AbstractController
{
private function howDaysToNy(DateTimeImmutable $date): int {
$endYear = date("Y-12-31", date_timestamp_get($date));
$dateInterval = date_diff(new DateTimeImmutable($endYear), $date);
return $dateInterval->format("%a") + 1;
}
#[Route('/', name: 'home')]
public function home(): Response
{
return $this->render('home.html.twig', ['count' => $count]);