Closed akloeckner closed 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?
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.
Thanks. Just did a minor style change.
Apparently, the new localization features convert the
label
of thetooltipItem
to something local.This results in something like
Mai 23, 2021, 1:03:51
, for me in German. If we try to convert that usingtimeAgo
, it fails.The fix uses the raw
dataset[].data[].x
, which isSun May 23 2021 01:03:51 GMT+0200 (Mitteleuropäische Sommerzeit)
in my case. This value can be converted to a time ago properly.