Add function to hass for calling relative_time #1681
colings
started this conversation in
Feature requests
Replies: 2 comments
-
|
@colings could you share your JS function? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Sure, here you go. This is using the last changed helper, so you'll need to tweak it to just use the normal last changed time instead of getLastChangeTime. Also, looking at it I skipped a few '1 day' vs 'x days' cases. It was supposed to just be temporary, lol. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I use a template to track the "real" last changed times of some of my entities, so restarting HA doesn't make it look like something changed with them.
See: https://community.home-assistant.io/t/persistent-version-of-last-changed-for-the-ui/467163/67
With button card there's a helper function I can pass the appropriate attribute from the template entity to to get a nicely formatted time (1 minute ago, last week, etc). It would be cool if Bubble Card added hass.relative_time so I could call that. For now I just wrote my own JS function to embed every time I need it, but using HA's version would be cleaner.
Beta Was this translation helpful? Give feedback.
All reactions