Unify date format in Foreman and plugins

Hello,

I'd like to suggest one recommended way of displaying date/time information on
all pages. We started a discussion in a PR [1] that would change the format
for config reports, please take a look there for possible solutions.

After a discussion with Roxanne (cc) on another page we agreed on following
form to be the best "April 10, 2017 17:08". So no timezone, no seconds, time
is localized in current user timezone. Users can quickly see how long it was
before so we didn't display the "x y ago" information. We could add it to
tooltip if needed.

Once nice thing about this format is that Rails provide helper to generate it.
One could use something like

<%= l(report.last_report_at, :format => :long) %>

which prints "April 10, 2017 17:08". The month name and potentially the format
is localized based on current user locale.

So before I start sending PRs to various places, I'd like to know if we can
all agree on one form, ideally the suggested one, and try to use it where it
make sense. Please vote either in here or in the linked PR.

The list of various places and formats in Foreman and plugins:

  • Core *
    reports page - reported at column: "about 1 month ago"
    dashboard page: "Generated at 12 Apr 12:41"
    facts - reported at columns: "about 1 year ago"
    trends page: "Last updated 1 day ago"
    audit: "about 1 hour ago" with tooltip saying "April 12, 2017 11:25"
    hosts - last report column: 2 months ago
    smart proxy - logs - time column: "11. 4. 2017 18:52:31"
    smart proxy - puppet ca - ca certificate expiry date: "in almost 4 years"

  • Plugins*
    discovery - last facts upload: "1 day ago"
    openscap reports: "about 1 month ago"
    tasks - task details info: "2 minutes ago" with tooltip "2017-04-12 12:49:00
    UTC"
    rex - jobs: "about 19 hours ago"
    rex - logs: "2017-04-11 19:48:09 +0200"
    katello - last checking, registered at: "2017-04-12 11:42:06 UTC"
    katello - content host tasks: 4/12/17 1:42 PM

Katello would probably need to implement the rails helper (or whatever format
we chose) in their UI helpers. Hopefully that's something easy to do.

[1] https://github.com/theforeman/foreman/pull/4419#issue-217527751

Thanks for reading and sorry for the long email

··· -- Marek

+1 on the format

To make sure I am clear:

  1. Dates will be stored in the DB as UTC.
  2. Dates will be shown to the user based on their locale.

Questions i have:

a) If I enter a new date, am I entering it in my time zone? Assume
serrver is in UTC +1 and I am in UTC -1. If I enter it in at 23:00 on 12
April, what is stored in the DB?
b) What preference/setting controls (2)

– bk

··· On 04/12/2017 09:39 AM, Marek Hulán wrote: > Hello, > > I'd like to suggest one recommended way of displaying date/time information on > all pages. We started a discussion in a PR [1] that would change the format > for config reports, please take a look there for possible solutions. > > After a discussion with Roxanne (cc) on another page we agreed on following > form to be the best "April 10, 2017 17:08". So no timezone, no seconds, time > is localized in current user timezone. Users can quickly see how long it was > before so we didn't display the "x y ago" information. We could add it to > tooltip if needed. > > Once nice thing about this format is that Rails provide helper to generate it. > One could use something like > > <%= l(report.last_report_at, :format => :long) %> > > which prints "April 10, 2017 17:08". The month name and potentially the format > is localized based on current user locale. > > So before I start sending PRs to various places, I'd like to know if we can > all agree on one form, ideally the suggested one, and try to use it where it > make sense. Please vote either in here or in the linked PR. > > The list of various places and formats in Foreman and plugins: > > * Core * > reports page - reported at column: "about 1 month ago" > dashboard page: "Generated at 12 Apr 12:41" > facts - reported at columns: "about 1 year ago" > trends page: "Last updated 1 day ago" > audit: "about 1 hour ago" with tooltip saying "April 12, 2017 11:25" > hosts - last report column: 2 months ago > smart proxy - logs - time column: "11. 4. 2017 18:52:31" > smart proxy - puppet ca - ca certificate expiry date: "in almost 4 years" > > * Plugins* > discovery - last facts upload: "1 day ago" > openscap reports: "about 1 month ago" > tasks - task details info: "2 minutes ago" with tooltip "2017-04-12 12:49:00 > UTC" > rex - jobs: "about 19 hours ago" > rex - logs: "2017-04-11 19:48:09 +0200" > katello - last checking, registered at: "2017-04-12 11:42:06 UTC" > katello - content host tasks: 4/12/17 1:42 PM > > Katello would probably need to implement the rails helper (or whatever format > we chose) in their UI helpers. Hopefully that's something easy to do. > > [1] https://github.com/theforeman/foreman/pull/4419#issue-217527751 > > Thanks for reading and sorry for the long email > > -- > Marek >

What is the effort to make this a user driven setting?
– bk

··· On 04/12/2017 09:39 AM, Marek Hulán wrote: > <%= l(report.last_report_at, :format => :long) %> > > which prints "April 10, 2017 17:08". The month name and potentially the format > is localized based on current user locale.

I like "ago" format with hover full date value. Thanks for putting
effort in this!

LZ

··· On Wed, Apr 12, 2017 at 3:39 PM, Marek Hulán wrote: > Hello, > > I'd like to suggest one recommended way of displaying date/time information on > all pages. We started a discussion in a PR [1] that would change the format > for config reports, please take a look there for possible solutions. > > After a discussion with Roxanne (cc) on another page we agreed on following > form to be the best "April 10, 2017 17:08". So no timezone, no seconds, time > is localized in current user timezone. Users can quickly see how long it was > before so we didn't display the "x y ago" information. We could add it to > tooltip if needed. > > Once nice thing about this format is that Rails provide helper to generate it. > One could use something like > > <%= l(report.last_report_at, :format => :long) %> > > which prints "April 10, 2017 17:08". The month name and potentially the format > is localized based on current user locale. > > So before I start sending PRs to various places, I'd like to know if we can > all agree on one form, ideally the suggested one, and try to use it where it > make sense. Please vote either in here or in the linked PR. > > The list of various places and formats in Foreman and plugins: > > * Core * > reports page - reported at column: "about 1 month ago" > dashboard page: "Generated at 12 Apr 12:41" > facts - reported at columns: "about 1 year ago" > trends page: "Last updated 1 day ago" > audit: "about 1 hour ago" with tooltip saying "April 12, 2017 11:25" > hosts - last report column: 2 months ago > smart proxy - logs - time column: "11. 4. 2017 18:52:31" > smart proxy - puppet ca - ca certificate expiry date: "in almost 4 years" > > * Plugins* > discovery - last facts upload: "1 day ago" > openscap reports: "about 1 month ago" > tasks - task details info: "2 minutes ago" with tooltip "2017-04-12 12:49:00 > UTC" > rex - jobs: "about 19 hours ago" > rex - logs: "2017-04-11 19:48:09 +0200" > katello - last checking, registered at: "2017-04-12 11:42:06 UTC" > katello - content host tasks: 4/12/17 1:42 PM > > Katello would probably need to implement the rails helper (or whatever format > we chose) in their UI helpers. Hopefully that's something easy to do. > > [1] https://github.com/theforeman/foreman/pull/4419#issue-217527751 > > Thanks for reading and sorry for the long email > > -- > Marek > > -- > 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 foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.


Later,
Lukas @lzap Zapletal

> +1 on the format
>
> To make sure I am clear:
>
> 1) Dates will be stored in the DB as UTC.
yes, but should not matter since the TZ info part of the value and we'd always
convert it according to current user locale

> 2) Dates will be shown to the user based on their locale.
yes

> Questions i have:
>
> a) If I enter a new date, am I entering it in my time zone? Assume
> serrver is in UTC +1 and I am in UTC -1. If I enter it in at 23:00 on 12
> April, what is stored in the DB?

I'm not sure if we enter the time somewhere. AFACT, rex has some time input
but I'm not sure how it deals with TZs exactly. I think we should use some
time picker in these cases where users would use their TZ and we should
convert it to UTC.

> b) What preference/setting controls (2)

go to editting form of your profile
$username in top right corner -> My account
see Timezone field which defaults to "Browser timezone" but can be set to any
time zone

··· On středa 12. dubna 2017 16:14:36 CEST Bryan Kearney wrote:


Marek

– bk

On 04/12/2017 09:39 AM, Marek Hulán wrote:

Hello,

I’d like to suggest one recommended way of displaying date/time
information on all pages. We started a discussion in a PR [1] that would
change the format for config reports, please take a look there for
possible solutions.

After a discussion with Roxanne (cc) on another page we agreed on
following
form to be the best “April 10, 2017 17:08”. So no timezone, no seconds,
time is localized in current user timezone. Users can quickly see how
long it was before so we didn’t display the “x y ago” information. We
could add it to tooltip if needed.

Once nice thing about this format is that Rails provide helper to generate
it. One could use something like

<%= l(report.last_report_at, :format => :long) %>

which prints “April 10, 2017 17:08”. The month name and potentially the
format is localized based on current user locale.

So before I start sending PRs to various places, I’d like to know if we
can
all agree on one form, ideally the suggested one, and try to use it where
it make sense. Please vote either in here or in the linked PR.

The list of various places and formats in Foreman and plugins:

  • Core *
    reports page - reported at column: "about 1 month ago"
    dashboard page: "Generated at 12 Apr 12:41"
    facts - reported at columns: "about 1 year ago"
    trends page: "Last updated 1 day ago"
    audit: “about 1 hour ago” with tooltip saying "April 12, 2017 11:25"
    hosts - last report column: 2 months ago
    smart proxy - logs - time column: "11. 4. 2017 18:52:31"
    smart proxy - puppet ca - ca certificate expiry date: “in almost 4 years”

  • Plugins*
    discovery - last facts upload: "1 day ago"
    openscap reports: "about 1 month ago"
    tasks - task details info: “2 minutes ago” with tooltip "2017-04-12
    12:49:00 UTC"
    rex - jobs: "about 19 hours ago"
    rex - logs: "2017-04-11 19:48:09 +0200"
    katello - last checking, registered at: "2017-04-12 11:42:06 UTC"
    katello - content host tasks: 4/12/17 1:42 PM

Katello would probably need to implement the rails helper (or whatever
format we chose) in their UI helpers. Hopefully that’s something easy to
do.

[1] https://github.com/theforeman/foreman/pull/4419#issue-217527751

Thanks for reading and sorry for the long email


Marek

I could imagine that as "easy", otoh I'd like to avoid adding more options
just because we're not sure. It's not critical I think. If we chose wrong
format, I'm happy to modify it in next version. Once we have it consistent,
it's easy to grep and change everywhere.

··· On středa 12. dubna 2017 19:12:32 CEST Bryan Kearney wrote: > On 04/12/2017 09:39 AM, Marek Hulán wrote: > > <%= l(report.last_report_at, :format => :long) %> > > > > which prints "April 10, 2017 17:08". The month name and potentially the > > format is localized based on current user locale. > > What is the effort to make this a user driven setting? > -- bk


Marek

>> +1 on the format
>>
>> To make sure I am clear:
>>
>> 1) Dates will be stored in the DB as UTC.
> yes, but should not matter since the TZ info part of the value and we'd always
> convert it according to current user locale
>
>> 2) Dates will be shown to the user based on their locale.
> yes
>
>> Questions i have:
>>
>> a) If I enter a new date, am I entering it in my time zone? Assume
>> serrver is in UTC +1 and I am in UTC -1. If I enter it in at 23:00 on 12
>> April, what is stored in the DB?
>
> I'm not sure if we enter the time somewhere. AFACT, rex has some time input
> but I'm not sure how it deals with TZs exactly. I think we should use some
> time picker in these cases where users would use their TZ and we should
> convert it to UTC.

I am thinking scap runs, katello syncplans are hte biggies.

>
>> b) What preference/setting controls (2)
>
> go to editting form of your profile
> $username in top right corner -> My account
> see Timezone field which defaults to "Browser timezone" but can be set to any
> time zone
>

thanks!
– bk

··· On 04/12/2017 11:55 AM, Marek Hulán wrote: > On středa 12. dubna 2017 16:14:36 CEST Bryan Kearney wrote:

I second that there are cases where "ago" is preferred. For the last
puppet run on the host page it's much easier to know if it was an hour
ago. Then I don't have to try and remember what day and time it is.
However, in a table of all puppet reports then the exact date is the
correct unit. The table of reports with a list of "about 1 month ago"
has been an annoyance

The same goes for the future value, like the puppet ca expiration date.
Knowing it's in about 4 years is sufficient knowledge. Whether it's in
May or December isn't that relevent at first sight because I know I
don't have to worry about it for some time.

Regarding the long format I find it much easier to read a table of
2017-04-12 rows than April. The length of each record should be constant
for easy visual comparison. If there is just one value then a
standardized long format would be preferable.

··· On Wed, Apr 12, 2017 at 04:18:30PM +0200, Lukas Zapletal wrote: > I like "ago" format with hover full date value. Thanks for putting > effort in this! > > LZ > > On Wed, Apr 12, 2017 at 3:39 PM, Marek Hulán wrote: > > Hello, > > > > I'd like to suggest one recommended way of displaying date/time information on > > all pages. We started a discussion in a PR [1] that would change the format > > for config reports, please take a look there for possible solutions. > > > > After a discussion with Roxanne (cc) on another page we agreed on following > > form to be the best "April 10, 2017 17:08". So no timezone, no seconds, time > > is localized in current user timezone. Users can quickly see how long it was > > before so we didn't display the "x y ago" information. We could add it to > > tooltip if needed. > > > > Once nice thing about this format is that Rails provide helper to generate it. > > One could use something like > > > > <%= l(report.last_report_at, :format => :long) %> > > > > which prints "April 10, 2017 17:08". The month name and potentially the format > > is localized based on current user locale. > > > > So before I start sending PRs to various places, I'd like to know if we can > > all agree on one form, ideally the suggested one, and try to use it where it > > make sense. Please vote either in here or in the linked PR. > > > > The list of various places and formats in Foreman and plugins: > > > > * Core * > > reports page - reported at column: "about 1 month ago" > > dashboard page: "Generated at 12 Apr 12:41" > > facts - reported at columns: "about 1 year ago" > > trends page: "Last updated 1 day ago" > > audit: "about 1 hour ago" with tooltip saying "April 12, 2017 11:25" > > hosts - last report column: 2 months ago > > smart proxy - logs - time column: "11. 4. 2017 18:52:31" > > smart proxy - puppet ca - ca certificate expiry date: "in almost 4 years" > > > > * Plugins* > > discovery - last facts upload: "1 day ago" > > openscap reports: "about 1 month ago" > > tasks - task details info: "2 minutes ago" with tooltip "2017-04-12 12:49:00 > > UTC" > > rex - jobs: "about 19 hours ago" > > rex - logs: "2017-04-11 19:48:09 +0200" > > katello - last checking, registered at: "2017-04-12 11:42:06 UTC" > > katello - content host tasks: 4/12/17 1:42 PM > > > > Katello would probably need to implement the rails helper (or whatever format > > we chose) in their UI helpers. Hopefully that's something easy to do. > > > > [1] https://github.com/theforeman/foreman/pull/4419#issue-217527751 > > > > Thanks for reading and sorry for the long email

Sorry, just to clarify what I meant. You were correct, DB will store the time
info in UTC without TZ info. The input value should contain the TZ info so we
can always convert it to UTC. Rubocop warns us when DateTime is used without
TZ in mind. If the input is not in UTC, the easiest way to convert it is
probably this

DateTime.now.utc.to_s(:db)

··· On středa 12. dubna 2017 17:55:21 CEST Marek Hulán wrote: > On středa 12. dubna 2017 16:14:36 CEST Bryan Kearney wrote: > > +1 on the format > > > > To make sure I am clear: > > > > 1) Dates will be stored in the DB as UTC. > > yes, but should not matter since the TZ info part of the value and we'd > always convert it according to current user locale


Marek

  1. Dates will be shown to the user based on their locale.

yes

Questions i have:

a) If I enter a new date, am I entering it in my time zone? Assume
serrver is in UTC +1 and I am in UTC -1. If I enter it in at 23:00 on 12
April, what is stored in the DB?

I’m not sure if we enter the time somewhere. AFACT, rex has some time input
but I’m not sure how it deals with TZs exactly. I think we should use some
time picker in these cases where users would use their TZ and we should
convert it to UTC.

b) What preference/setting controls (2)

go to editting form of your profile
$username in top right corner -> My account
see Timezone field which defaults to “Browser timezone” but can be set to
any time zone


Marek

– bk

On 04/12/2017 09:39 AM, Marek Hulán wrote:

Hello,

I’d like to suggest one recommended way of displaying date/time
information on all pages. We started a discussion in a PR [1] that would
change the format for config reports, please take a look there for
possible solutions.

After a discussion with Roxanne (cc) on another page we agreed on
following
form to be the best “April 10, 2017 17:08”. So no timezone, no seconds,
time is localized in current user timezone. Users can quickly see how
long it was before so we didn’t display the “x y ago” information. We
could add it to tooltip if needed.

Once nice thing about this format is that Rails provide helper to
generate
it. One could use something like

<%= l(report.last_report_at, :format => :long) %>

which prints “April 10, 2017 17:08”. The month name and potentially the
format is localized based on current user locale.

So before I start sending PRs to various places, I’d like to know if we
can
all agree on one form, ideally the suggested one, and try to use it
where
it make sense. Please vote either in here or in the linked PR.

The list of various places and formats in Foreman and plugins:

  • Core *
    reports page - reported at column: "about 1 month ago"
    dashboard page: "Generated at 12 Apr 12:41"
    facts - reported at columns: "about 1 year ago"
    trends page: "Last updated 1 day ago"
    audit: “about 1 hour ago” with tooltip saying "April 12, 2017 11:25"
    hosts - last report column: 2 months ago
    smart proxy - logs - time column: "11. 4. 2017 18:52:31"
    smart proxy - puppet ca - ca certificate expiry date: “in almost 4
    years”

  • Plugins*
    discovery - last facts upload: "1 day ago"
    openscap reports: "about 1 month ago"
    tasks - task details info: “2 minutes ago” with tooltip "2017-04-12
    12:49:00 UTC"
    rex - jobs: "about 19 hours ago"
    rex - logs: "2017-04-11 19:48:09 +0200"
    katello - last checking, registered at: "2017-04-12 11:42:06 UTC"
    katello - content host tasks: 4/12/17 1:42 PM

Katello would probably need to implement the rails helper (or whatever
format we chose) in their UI helpers. Hopefully that’s something easy to
do.

[1] https://github.com/theforeman/foreman/pull/4419#issue-217527751

Thanks for reading and sorry for the long email


Marek

kk… sounds fair. Perhaps add an abstraction onto it so it can be
changed in one place?

– bk

··· On 04/13/2017 03:53 AM, Marek Hulán wrote: > On středa 12. dubna 2017 19:12:32 CEST Bryan Kearney wrote: >> On 04/12/2017 09:39 AM, Marek Hulán wrote: >>> <%= l(report.last_report_at, :format => :long) %> >>> >>> which prints "April 10, 2017 17:08". The month name and potentially the >>> format is localized based on current user locale. >> >> What is the effort to make this a user driven setting? >> -- bk > > I could imagine that as "easy", otoh I'd like to avoid adding more options > just because we're not sure. It's not critical I think. If we chose wrong > format, I'm happy to modify it in next version. Once we have it consistent, > it's easy to grep and change everywhere. > > -- > Marek >

Thanks guys so far, I'm sending comments below in text that are also relevant
for lzap's comments in previous email.

> I second that there are cases where "ago" is preferred. For the last
> puppet run on the host page it's much easier to know if it was an hour
> ago. Then I don't have to try and remember what day and time it is.
> However, in a table of all puppet reports then the exact date is the
> correct unit. The table of reports with a list of "about 1 month ago"
> has been an annoyance

I agree that sometime it's more convenient. On reports page it might be
interesting only for reports that arrived withing last few hours though. IMHO
the consistency is the key here, I'd like to avoid showing 15 minutes ago for
times < few hours and full info for the rest. Most of reports on the page
(older than few hours) would benefit from the full format. Therefore I think
full format with "ago" information as tooltip might be the best compromise?

> The same goes for the future value, like the puppet ca expiration date.
> Knowing it's in about 4 years is sufficient knowledge. Whether it's in
> May or December isn't that relevent at first sight because I know I
> don't have to worry about it for some time.

Fair enough, in this case we can keep the format we have. Hopefully noone
starts to replace the certificate when they see "in about 1 hour" :slight_smile:

> Regarding the long format I find it much easier to read a table of
> 2017-04-12 rows than April. The length of each record should be constant
> for easy visual comparison. If there is just one value then a
> standardized long format would be preferable.

Understood. I think the change of month in 30 rows is more visible so you
visually see where one month starts and another begins. Also all April rows
will have the info of same length. But I don't insist, we'll see when we have
opinions from more.

··· On středa 12. dubna 2017 16:56:52 CEST Ewoud Kohl van Wijngaarden wrote:


Marek

On Wed, Apr 12, 2017 at 04:18:30PM +0200, Lukas Zapletal wrote:

I like “ago” format with hover full date value. Thanks for putting
effort in this!

LZ

On Wed, Apr 12, 2017 at 3:39 PM, Marek Hulán mhulan@redhat.com wrote:

Hello,

I’d like to suggest one recommended way of displaying date/time
information on all pages. We started a discussion in a PR [1] that
would change the format for config reports, please take a look there
for possible solutions.

After a discussion with Roxanne (cc) on another page we agreed on
following
form to be the best “April 10, 2017 17:08”. So no timezone, no seconds,
time is localized in current user timezone. Users can quickly see how
long it was before so we didn’t display the “x y ago” information. We
could add it to tooltip if needed.

Once nice thing about this format is that Rails provide helper to
generate it. One could use something like

<%= l(report.last_report_at, :format => :long) %>

which prints “April 10, 2017 17:08”. The month name and potentially the
format is localized based on current user locale.

So before I start sending PRs to various places, I’d like to know if we
can
all agree on one form, ideally the suggested one, and try to use it
where it make sense. Please vote either in here or in the linked PR.

The list of various places and formats in Foreman and plugins:

  • Core *
    reports page - reported at column: "about 1 month ago"
    dashboard page: "Generated at 12 Apr 12:41"
    facts - reported at columns: "about 1 year ago"
    trends page: "Last updated 1 day ago"
    audit: “about 1 hour ago” with tooltip saying "April 12, 2017 11:25"
    hosts - last report column: 2 months ago
    smart proxy - logs - time column: "11. 4. 2017 18:52:31"
    smart proxy - puppet ca - ca certificate expiry date: “in almost 4
    years”

  • Plugins*
    discovery - last facts upload: "1 day ago"
    openscap reports: "about 1 month ago"
    tasks - task details info: “2 minutes ago” with tooltip "2017-04-12
    12:49:00 UTC"
    rex - jobs: "about 19 hours ago"
    rex - logs: "2017-04-11 19:48:09 +0200"
    katello - last checking, registered at: "2017-04-12 11:42:06 UTC"
    katello - content host tasks: 4/12/17 1:42 PM

Katello would probably need to implement the rails helper (or whatever
format we chose) in their UI helpers. Hopefully that’s something easy
to do.

[1] https://github.com/theforeman/foreman/pull/4419#issue-217527751

Thanks for reading and sorry for the long email

> Thanks guys so far, I'm sending comments below in text that are also relevant
> for lzap's comments in previous email.
>
> > I second that there are cases where "ago" is preferred. For the last
> > puppet run on the host page it's much easier to know if it was an hour
> > ago. Then I don't have to try and remember what day and time it is.
> > However, in a table of all puppet reports then the exact date is the
> > correct unit. The table of reports with a list of "about 1 month ago"
> > has been an annoyance
>
> I agree that sometime it's more convenient. On reports page it might be
> interesting only for reports that arrived withing last few hours though. IMHO
> the consistency is the key here, I'd like to avoid showing 15 minutes ago for
> times < few hours and full info for the rest. Most of reports on the page
> (older than few hours) would benefit from the full format. Therefore I think
> full format with "ago" information as tooltip might be the best compromise?

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.

> > The same goes for the future value, like the puppet ca expiration date.
> > Knowing it's in about 4 years is sufficient knowledge. Whether it's in
> > May or December isn't that relevent at first sight because I know I
> > don't have to worry about it for some time.
>
> Fair enough, in this case we can keep the format we have. Hopefully noone
> starts to replace the certificate when they see "in about 1 hour" :slight_smile:

T-10, 9, 8 … :slight_smile:

> > Regarding the long format I find it much easier to read a table of
> > 2017-04-12 rows than April. The length of each record should be constant
> > for easy visual comparison. If there is just one value then a
> > standardized long format would be preferable.
>
> Understood. I think the change of month in 30 rows is more visible so you
> visually see where one month starts and another begins. Also all April rows
> will have the info of same length. But I don't insist, we'll see when we have
> opinions from more.

That's also a fair point. If you go for the 3 letter versions (Apr vs
April) then that could be a good compromise.

··· On Wed, Apr 12, 2017 at 06:02:34PM +0200, Marek Hulán wrote: > On středa 12. dubna 2017 16:56:52 CEST Ewoud Kohl van Wijngaarden wrote:


Marek

On Wed, Apr 12, 2017 at 04:18:30PM +0200, Lukas Zapletal wrote:

I like “ago” format with hover full date value. Thanks for putting
effort in this!

LZ

On Wed, Apr 12, 2017 at 3:39 PM, Marek Hulán mhulan@redhat.com wrote:

Hello,

I’d like to suggest one recommended way of displaying date/time
information on all pages. We started a discussion in a PR [1] that
would change the format for config reports, please take a look there
for possible solutions.

After a discussion with Roxanne (cc) on another page we agreed on
following
form to be the best “April 10, 2017 17:08”. So no timezone, no seconds,
time is localized in current user timezone. Users can quickly see how
long it was before so we didn’t display the “x y ago” information. We
could add it to tooltip if needed.

Once nice thing about this format is that Rails provide helper to
generate it. One could use something like

<%= l(report.last_report_at, :format => :long) %>

which prints “April 10, 2017 17:08”. The month name and potentially the
format is localized based on current user locale.

So before I start sending PRs to various places, I’d like to know if we
can
all agree on one form, ideally the suggested one, and try to use it
where it make sense. Please vote either in here or in the linked PR.

The list of various places and formats in Foreman and plugins:

  • Core *
    reports page - reported at column: "about 1 month ago"
    dashboard page: "Generated at 12 Apr 12:41"
    facts - reported at columns: "about 1 year ago"
    trends page: "Last updated 1 day ago"
    audit: “about 1 hour ago” with tooltip saying "April 12, 2017 11:25"
    hosts - last report column: 2 months ago
    smart proxy - logs - time column: "11. 4. 2017 18:52:31"
    smart proxy - puppet ca - ca certificate expiry date: “in almost 4
    years”

  • Plugins*
    discovery - last facts upload: "1 day ago"
    openscap reports: "about 1 month ago"
    tasks - task details info: “2 minutes ago” with tooltip "2017-04-12
    12:49:00 UTC"
    rex - jobs: "about 19 hours ago"
    rex - logs: "2017-04-11 19:48:09 +0200"
    katello - last checking, registered at: "2017-04-12 11:42:06 UTC"
    katello - content host tasks: 4/12/17 1:42 PM

Katello would probably need to implement the rails helper (or whatever
format we chose) in their UI helpers. Hopefully that’s something easy
to do.

[1] https://github.com/theforeman/foreman/pull/4419#issue-217527751

Thanks for reading and sorry for the long email


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 foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I totally agree. Let's not drop the "time ago in words" format entirely.
It does make sense in a lot of places, especially reports or
certificates or when a host was created. As a user you probably don't
care for the exact time. You just want to know approximately when it
happened.
E.g. when you push new puppet code to your production servers and start
to get calls that something is broken, it's enough to know that there
are puppet reports that indicate a change happend to your servers within
the last hour. As puppet runs happen, when they happen (and the time
when puppet applies changes is hard to predict) an exact timestamp isn't
useful as your cluster slowly starts to degrade over time.

  • Timo
··· Am 12.04.17 um 18:21 schrieb Ewoud Kohl van Wijngaarden: > On Wed, Apr 12, 2017 at 06:02:34PM +0200, Marek Hulán wrote: >> Thanks guys so far, I'm sending comments below in text that are also relevant >> for lzap's comments in previous email. >> >> On středa 12. dubna 2017 16:56:52 CEST Ewoud Kohl van Wijngaarden wrote: >>> I second that there are cases where "ago" is preferred. For the last >>> puppet run on the host page it's much easier to know if it was an hour >>> ago. Then I don't have to try and remember what day and time it is. >>> However, in a table of all puppet reports then the exact date is the >>> correct unit. The table of reports with a list of "about 1 month ago" >>> has been an annoyance >> I agree that sometime it's more convenient. On reports page it might be >> interesting only for reports that arrived withing last few hours though. IMHO >> the consistency is the key here, I'd like to avoid showing 15 minutes ago for >> times < few hours and full info for the rest. Most of reports on the page >> (older than few hours) would benefit from the full format. Therefore I think >> full format with "ago" information as tooltip might be the best compromise? > 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.

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?

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.

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.

··· On čtvrtek 13. dubna 2017 8:13:11 CEST Timo Goebel wrote: > Am 12.04.17 um 18:21 schrieb Ewoud Kohl van Wijngaarden: > > On Wed, Apr 12, 2017 at 06:02:34PM +0200, Marek Hulán wrote: > >> Thanks guys so far, I'm sending comments below in text that are also > >> relevant for lzap's comments in previous email. > >> > >> On středa 12. dubna 2017 16:56:52 CEST Ewoud Kohl van Wijngaarden wrote: > >>> I second that there are cases where "ago" is preferred. For the last > >>> puppet run on the host page it's much easier to know if it was an hour > >>> ago. Then I don't have to try and remember what day and time it is. > >>> However, in a table of all puppet reports then the exact date is the > >>> correct unit. The table of reports with a list of "about 1 month ago" > >>> has been an annoyance > >> > >> I agree that sometime it's more convenient. On reports page it might be > >> interesting only for reports that arrived withing last few hours though. > >> IMHO the consistency is the key here, I'd like to avoid showing 15 > >> minutes ago for times < few hours and full info for the rest. Most of > >> reports on the page (older than few hours) would benefit from the full > >> format. Therefore I think full format with "ago" information as tooltip > >> might be the best compromise?> > > 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. > > I totally agree. Let's not drop the "time ago in words" format entirely. > It does make sense in a lot of places, especially reports or > certificates or when a host was created. As a user you probably don't > care for the exact time. You just want to know approximately when it > happened. > E.g. when you push new puppet code to your production servers and start > to get calls that something is broken, it's enough to know that there > are puppet reports that indicate a change happend to your servers within > the last hour. As puppet runs happen, when they happen (and the time > when puppet applies changes is hard to predict) an exact timestamp isn't > useful as your cluster slowly starts to degrade over time.


Marek

+1 for consistency, further comments below :wink:

> > > 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 :slight_smile:

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 :wink:

Greg

··· On Thu, 2017-04-13 at 10:05 +0200, Marek Hulán wrote: