-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[webui] show timestamps in package revisions #2469
[webui] show timestamps in package revisions #2469
Conversation
@@ -21,7 +21,9 @@ | |||
committed | |||
<% end %> | |||
<% end %> | |||
<%= fuzzy_time(Time.at(commit['time'].to_i)) %> (revision <%= commit['rev'] %>) | |||
<% time = Time.at(commit['time'].to_i) %> | |||
<span title="<%= time.utc %>" class='commit-fuzzy-time'><%= fuzzy_time(time) %></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about integrating this into the fuzzy_time helper instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But fuzzy_time
is called from different places, do we want to change this everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I don't like rendering UTC. And I think that the seconds are not necessary.
What about something like this:
time.strftime("%Y-%m-%d %H:%M")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing it everywhere, where it makes sense, sounds like a good idea. So that we stay consistent.
Nice one |
@@ -21,7 +21,9 @@ | |||
committed | |||
<% end %> | |||
<% end %> | |||
<%= fuzzy_time(Time.at(commit['time'].to_i)) %> (revision <%= commit['rev'] %>) | |||
<% time = Time.at(commit['time'].to_i) %> | |||
<span title="<%= time.utc %>" class='commit-fuzzy-time'><%= fuzzy_time(time) %></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I don't like rendering UTC. And I think that the seconds are not necessary.
What about something like this:
time.strftime("%Y-%m-%d %H:%M")
As long as the world hasn't agreed on a single timezone, you have to specify which one was used on the server. That's actually the charme of solutions like jquery.timeago where the date is rendered by the browser. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as the world hasn't agreed on a single timezone, you have to specify which one was used on the server. That's actually the charme of solutions like jquery.timeago where the date is rendered by the browser.
I would prefer using jquery than rendering UTC
human_time_ago = time_ago_in_words(time) + ' ago' | ||
|
||
if with_fulltime | ||
raw("<span title='#{time.utc}' class='fuzzy-time'>#{human_time_ago}</span>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer not to render seconds.
Using jquery.timeago would only make sense if all times are displayed in the local client timezone. They are not, so this would be very confusing I guess. |
157fae0
to
34d4d50
Compare
@Ana06, when you can, please check if the changes. |
it { expect(fuzzy_time(Time.now)).to eq('now') } | ||
end | ||
|
||
context 'with_fulltime' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this testing? :-) strftime?
Related with issue #2164
Before:
After: