-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify all times shown to not use any words, just exact numbers
So everything is hardcoded to English and we don't need to set a locale or having mixed-language phrases all over the place.
- Loading branch information
Showing
13 changed files
with
18 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,5 @@ | ||
module MissionControl::Jobs::DatesHelper | ||
def time_ago_in_words_with_title(time) | ||
tag.span time_ago_in_words(time), title: time.to_fs(:long) | ||
end | ||
|
||
def time_distance_in_words_with_title(time) | ||
tag.span distance_of_time_in_words_to_now(time, include_seconds: true), title: "Since #{time.to_fs(:long)}" | ||
end | ||
|
||
def bidirectional_time_distance_in_words_with_title(time) | ||
time_distance = if time.past? | ||
"#{distance_of_time_in_words_to_now(time, include_seconds: true)} ago" | ||
else | ||
"in #{distance_of_time_in_words_to_now(time, include_seconds: true)}" | ||
end | ||
|
||
tag.span time_distance, title: time.to_fs(:long) | ||
def formatted_time(time) | ||
time.strftime("%Y-%m-%d %H:%M:%S.%3N") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<td><%= link_to job.queue_name, application_queue_path(@application, job.queue) %></td> | ||
<td><div class="is-family-monospace is-size-7"><%= job.blocked_by %></div></td> | ||
<td><%= bidirectional_time_distance_in_words_with_title(job.blocked_until) %></td> | ||
<td><%= formatted_time(job.blocked_until) %></td> | ||
<td class="pr-0"> | ||
<%= render "mission_control/jobs/jobs/blocked/actions", job: job %> | ||
</td> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<td><%= link_to job.queue_name, application_queue_path(@application, job.queue) %></td> | ||
<td><div class="has-text-grey"><%= time_ago_in_words_with_title(job.finished_at) %> ago</div></td> | ||
<td><div class="has-text-grey"><%= formatted_time(job.finished_at) %></div></td> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters