+1 for consistency, further comments below ;)

On Thu, 2017-04-13 at 10:05 +0200, Marek Hulán wrote:
> > > On the reports (where you see multiple) then I think the "ago"
> > > format isn't useful because the granularity is too low so it's
> > > hard to compare. IMHO in a list they should all have the same
> > > format. On a host page where you see "Last report: 1 hour ago" it
> > > does make sense. I hope that clarifies it.

+1 to the fact that it doesn't always make sense to use "ago".

> > I totally agree. Let's not drop the "time ago in words" format
> > entirely.
> 
> Right, there are places where it makes sense. How about there was
> always a tooltip so when you hover over "ago" it would display
> timestamp and vice versa?

+1 to the fact that it does *sometimes* make sense :)

I think it makes sense to separate "absolute time" from "relative
time". Each of those things has it's use, as has already been said -
absolute time is usually better in lists, relative time is usually
better in information on an object (although there will be exceptions
to these rules, of course).

Perhaps we should accept that these two things need to exist, and
define a consistent format for both?

> Second thing is what the format of timestamp there (and everywhere
> where we use it) should be. And that's something I'd like to unify
> everywhere including plugins. Maybe the core should provide a helper
> that plugins should use to format the date.

+1 for a helper for each of these two objects. Then we can use them
where needed, for example (warning, bad psuedocode ahead):

Report#index: at: <%= absolute_time %>, tooltip <%= relative_time %>
Host#show: reported_at: <%= relative_time %>
Certs#index: cert: <%= relative_time %>, tooltip <%= absolute_time %>
... and so on

It's a slight increase in complexity over the initial proposal.
However, this way it'll still be much more consistent about how to
present information, and be easier to change formats in future, without
losing the option to display text in the way that makes the most sense
based on the context.

> Also I should have separated two things. At some pages (e.g. reports
> list) I'd like to change "ago" to timestamp. We can discuss every
> occurrence individually, when I send a PR, I'll post a link here.
> Based on above, I won't change e.g. smart proxy ca expiration.

+1 to gradual change, but let's define these helpers first, it'll make
the PRs for changes much smaller ;)

Greg

-- 
You received this message because you are subscribed to the Google Groups 
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to