Skip to content
This repository has been archived by the owner on May 26, 2021. It is now read-only.

Commit

Permalink
Add timezone to failed_at/retried_at on resque-web to show relative t…
Browse files Browse the repository at this point in the history
…ime correctly when a viewer is in a different timezone from a server.
  • Loading branch information
ono committed Apr 12, 2011
1 parent 246a082 commit 9dbdf36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/resque/server.rb
Expand Up @@ -2,6 +2,7 @@
require 'erb'
require 'resque'
require 'resque/version'
require 'time'

module Resque
class Server < Sinatra::Base
Expand Down
4 changes: 2 additions & 2 deletions lib/resque/server/views/failed.erb
Expand Up @@ -22,10 +22,10 @@
<% else %>
<dt>Worker</dt>
<dd>
<a href="<%= u(:workers, job['worker']) %>"><%= job['worker'].split(':')[0...2].join(':') %></a> on <b class='queue-tag'><%= job['queue'] %></b > at <b><span class="time"><%= job['failed_at'] %></span></b>
<a href="<%= u(:workers, job['worker']) %>"><%= job['worker'].split(':')[0...2].join(':') %></a> on <b class='queue-tag'><%= job['queue'] %></b > at <b><span class="time"><%= Time.parse(job['failed_at']).strftime("%F %T %z") %></span></b>
<% if job['retried_at'] %>
<div class='retried'>
Retried <b><span class="time"><%= job['retried_at'] %></span></b>
Retried <b><span class="time"><%= Time.parse(job['retried_at']).strftime("%F %T %z") %></span></b>
<a href="<%= u "failed/remove/#{start + index - 1}" %>" class="remove" rel="remove">Remove</a>
</div>
<% else %>
Expand Down

0 comments on commit 9dbdf36

Please sign in to comment.