Closed viktak closed 3 years ago
The following code is working properly in a markdown card, so I assume my templates are correct:
- type: markdown
title: Recent Earthquakes
content: |
{% for quake in state_attr('sensor.earthquakes','earthquakes') %}
{{ quake.magnitude }}: [{{ quake.title }}]({{ quake.link }}) {{ quake.distance }}km
{{ quake.time.strftime("%b %d %X")}}
{% endfor %}
field is the name of a column, so current time will not work there
Checklist:
Release with the issue: 1.3.0 Last working release (if known):
Browser and Operating System: Windows 10 Pro 64
Description of problem: Trying to template the `list-card' using the following code:
Line
field: '${ time.strftime("%b %d %X") }'
causes the whole thing to not render.{{ state_attr('sensor.earthquakes','earthquakes')[0].time.strftime("%b %d %X") }}
in the Template tester renders correctly asFeb 12 12:03:13
Javascript errors shown in the web inspector (if applicable):
Additional information: I am using the earthquake integration as a source to the list.