我想应用一个条件,即当当前日期超过调查答案截止日期时,相应的表不可见。为此,我尝试了下面的代码,但它不起作用。有人能为我的问题提供确切的解决方案吗。
<tr t-if="datetime.datetime.now().strftime('%Y-%m-%d 00:00:00') > ans.date_create">
提前谢谢。
您可以使用ans.date_create
来获取当前日期时间并替换该时间。
t-if="ans.date_create.now().replace(hour=0, minute=0, second=0, microsecond=0) > ans.date_create"