Closed martinpitt closed 1 week ago
The tests still need updating, but I'd appreciate a first review if this approach is ok or we should rebuild the quasi-absolute relative/fuzzy formatRelative() in terms of Intl
.
I guess the layout issues in the first screenshot aren't addressed, and it's just coincidence that it's not so broken in the second screenshot?
@garrett Right, this changes no layout at all. I just took the screenshots at different resolutions because reasons (mostly because firefox screenshots don't catch tooltips, so I did a full-screen snapshot). This is just about the time format.
@jelly As Katerina and Garrett already acked this, I'll leave the review to you -- I think you had some criticism?
@jelly As Katerina and Garrett already acked this, I'll leave the review to you -- I think you had some criticism?
I thought Garrett would have objections, if its fine with him lets merge it.
We use
timeformat.distanceToNow()
in most places in cockpit. Use that for consistency rather than showing a fuzzified absolut/relative time stamp mix with date-fn's formatRelative(). For more precision, show the absolute creation time in a tooltip.This weans cockpit-machines off the date-fns API, which we try to get rid of (https://github.com/cockpit-project/cockpit/issues/20653).
Current main:
This PR: