Skip to content

Commit

Permalink
improve names and callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilherme Quirino committed Aug 7, 2019
1 parent 98260d0 commit 15dd98b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/sidekiq/statistic/locales/pt-br.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ pt-br: # <---- change this to your locale code
SearchLogs: Pesquisar no arquivo de logs
date:
formats:
withoutTime: "%d/%m/%Y"
withTime: "%d/%m/%Y - %T"
default: "%d/%m/%Y"
datetime: "%d/%m/%Y - %T"

2 changes: 1 addition & 1 deletion lib/sidekiq/statistic/views/statistic.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<td class="worker">
<a href="<%= root_path %>statistic/<%= worker[:name] %>"><%= worker[:name] %></a>
</td>
<td class="worker"><%= format_date worker[:runtime][:last], 'withTime' %></td>
<td class="worker"><%= format_date worker[:runtime][:last], 'datetime' %></td>
<td class="worker"><%= worker[:queue] %></td>
<td class="worker"><%= worker[:number_of_calls][:success] %></td>
<td class="worker"><%= worker[:number_of_calls][:failure] %></td>
Expand Down
4 changes: 2 additions & 2 deletions lib/sidekiq/statistic/views/worker.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
</thead>
<% @worker_statistic.each do |worker| %>
<tr>
<td class="worker"><%= format_date worker[:date], 'withoutTime' %></td>
<td class="worker"><%= format_date worker[:runtime][:last], 'withTime' %></td>
<td class="worker"><%= format_date worker[:date] %></td>
<td class="worker"><%= format_date worker[:runtime][:last], 'datetime' %></td>
<td class="worker"><%= worker[:success] %></td>
<td class="worker"><%= worker[:failure] %></td>
<td class="worker"><%= worker[:total] %></td>
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/statistic/web_extension_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def calculate_date_range(params)
private

def date_format(format)
get_locale.dig('date', 'formats', format) || '%m/%e/%Y - %T'
get_locale.dig('date', 'formats', format || 'default') || '%m/%d/%Y'
end

def convert_to_date_object(date)
Expand Down

0 comments on commit 15dd98b

Please sign in to comment.