resoai / TileBoard

A simple yet highly configurable Dashboard for HomeAssistant
MIT License
1.63k stars 278 forks source link

fix(HISTORY): fix tooltip time for some locales #724

Closed akloeckner closed 3 years ago

akloeckner commented 3 years ago

Apparently, the new localization features convert the label of the tooltipItem to something local.

This results in something like Mai 23, 2021, 1:03:51, for me in German. If we try to convert that using timeAgo, it fails.

The fix uses the raw dataset[].data[].x, which is Sun May 23 2021 01:03:51 GMT+0200 (Mitteleuropäische Sommerzeit) in my case. This value can be converted to a time ago properly.

rchl commented 3 years ago

Why do you think that this is universally a good change? The localized seems much more readable than the raw value.

I understand the issue with not being able to use timeAgo but I don't think this warrants making it worse for the common case. Maybe there is another solution to that?

akloeckner commented 3 years ago

I was not clear enough. The fix uses the raw value and converts it to timeAgo.

The current code is actually broken for me. It shows invalid date in the tooltip. So, this is actually really only a fix.

rchl commented 3 years ago

Thanks. Just did a minor style change.