简体   繁体   English

Typo3 tx_news eventnews:在 tx_news 的列表视图中显示结束日期和位置

[英]Typo3 tx_news eventnews: show enddate and location in list view of tx_news

I am trying to add the enddate and the location to the list view of the news records.我正在尝试将结束日期和位置添加到新闻记录的列表视图中。 For the location it was quite straight forward {newsItem.location.title} but the enddate does not work.对于位置,它非常简单{newsItem.location.title}但结束日期不起作用。 I tried all different things like:我尝试了所有不同的事情,例如:

{newsItem.event_end}
{newsItem.eventEnd}
{f:format.date(date:newsItem.eventEnd.date,format:'%d.%m.%Y')}

and {f:format.date(date:n.eventEnd.date,format:'%d.%m.%Y')} like in the month view but that gives some weird date.{f:format.date(date:n.eventEnd.date,format:'%d.%m.%Y')}就像在月视图中一样,但这给出了一些奇怪的日期。

I assume you got weird results as you missed the correct data and the correct formatting.我假设你错过了正确的数据和正确的格式,得到了奇怪的结果。

I assume that {newsItem.event_end} results in 0我假设{newsItem.event_end}结果为0
{newsItem.eventEnd} propably gives you a big number like 1623997520 , which is a unix-timestamp and gives the seconds since "1.1.1970 0:00". {newsItem.eventEnd}可能会给你一个大数字,比如1623997520 ,这是一个unix时间戳,给1623997520 “1.1.1970 0:00”以来的秒数。 this just needs some formatting:这只需要一些格式:

In your formatted try you access newsItem.eventEnd.date as data, but that also is not defined.在格式化的尝试中,您将newsItem.eventEnd.date作为数据访问,但这也未定义。

I prefer the inline format, so it's more obvious which data is shown:我更喜欢内联格式,因此显示哪些数据更明显:
{newsItem.eventEnd->f:format.date(format:'%d.%m.%Y')}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM