Hallo,
ich möchte in den Nachrichten (news_full.html5) nur das Datum anzeigen lassen. In Contao 4.13 hat das noch hiermit funktioniert:
PHP-Code:
<time datetime="<?= $this->datetime ?>" itemprop="datePublished"><?= $this->parseDate("d.M.Y", $this->timestamp) ?></time>
Jetzt habe ich eine Contao 5.1.6 installation, und hier funktioniert der Code nicht mehr. Es steht folgende Meldung im Log:
Code:
[2023-05-16T13:05:35.444678+02:00] request.INFO: Matched route "tl_page.2". {"route":"tl_page.2","route_parameters":{"_token_check":true,"_controller":"Contao\\FrontendIndex::renderPage","_scope":"frontend","_locale":"de","_format":"html","_canonical_route":"tl_page.2","parameters":"","pageModel":{"Contao\\PageModel":[]},"_route":"tl_page.2","_route_object":{"Contao\\CoreBundle\\Routing\\Page\\PageRoute":[]}},"request_uri":"https://intranet.local/startseite","method":"GET"} []
[2023-05-16T13:05:35.712777+02:00] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "parseDate is not set or not a callable" at C:\htdocs\intranet\vendor\contao\core-bundle\contao\library\Contao\Template.php line 182 {"exception":"[object] (InvalidArgumentException(code: 0): parseDate is not set or not a callable at C:\\htdocs\\intranet\\vendor\\contao\\core-bundle\\contao\\library\\Contao\\Template.php:182)"} []
[2023-05-16T13:05:35.836453+02:00] messenger.INFO: Sending message Contao\CoreBundle\Messenger\Message\SearchIndexMessage with contao_prio_low sender using Contao\CoreBundle\Messenger\Transport\AutoFallbackTransport {"class":"Contao\\CoreBundle\\Messenger\\Message\\SearchIndexMessage","alias":"contao_prio_low","sender":"Contao\\CoreBundle\\Messenger\\Transport\\AutoFallbackTransport"} []
[2023-05-16T13:05:35.837128+02:00] messenger.INFO: Received message Contao\CoreBundle\Messenger\Message\SearchIndexMessage {"class":"Contao\\CoreBundle\\Messenger\\Message\\SearchIndexMessage"} []
[2023-05-16T13:05:35.842781+02:00] messenger.INFO: Message Contao\CoreBundle\Messenger\Message\SearchIndexMessage handled by Contao\CoreBundle\Messenger\MessageHandler\SearchIndexMessageHandler::__invoke {"class":"Contao\\CoreBundle\\Messenger\\Message\\SearchIndexMessage","handler":"Contao\\CoreBundle\\Messenger\\MessageHandler\\SearchIndexMessageHandler::__invoke"} []
Kann mir bitte jemand veraten, wie ich parseDate nun richtig verwende?