I am trying to format the string from sun.sun.next_rising
but I keep getting the error
TypeError: entity.attributes.next_rising.strftime is not a function
at eval (eval at evaluate (floorplan.js:49), <anonymous>:3:86)
How should I format this string?
for reference this is my ha-floorplan.yml
views:
- title: Home
path: home
icon: 'mdi:floor-plan'
theme: ''
panel: true
badges: []
cards:
- type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: 'custom:floorplan-card'
full_height: true
config:
image: /local/floorplan/home/home.svg
stylesheet: /local/floorplan/home/home.css
log_level: info
console_log_level: info
defaults:
hover_action: hover-info
tap_action: more-info
rules:
- entity: weather.home
state_action:
- service: floorplan.text_set
service_data:
element: outside.temp
text: >
> return (entity.attributes.temperature !==
undefined) ? entity.state + " °F" : "unknown";
- entity: sun.sun
state_action:
- service: floorplan.text_set
service_data:
element: sun.sun
text: >
> return (entity.attributes.next_rising !==
undefined) ?
entity.attributes.next_rising.strftime('%b %d,
%Y') : "unknown";
title: Home