--- a/lib/CrashTest/Helper/DateTime.pm Sun Feb 14 23:47:24 2016 +0100
+++ b/lib/CrashTest/Helper/DateTime.pm Sun Feb 14 23:56:24 2016 +0100
@@ -30,6 +30,18 @@
return "" unless $d;
$d->strftime("%FT%TZ");
});
+
+ $app->helper(human_date_from_epoch => sub {
+ my ($c, $ts) = @_;
+ my $d;
+ eval {
+ $d = DateTime->from_epoch(epoch => $ts);
+ };
+ $c->app->log->warn($@) if $@;
+ return "" unless $d;
+ $d->set_time_zone('local')->strftime("%F %T");
+ });
+
}
sub _date_from_db_utc {
--- a/templates/report/client_info.html.ep Sun Feb 14 23:47:24 2016 +0100
+++ b/templates/report/client_info.html.ep Sun Feb 14 23:56:24 2016 +0100
@@ -1,10 +1,10 @@
<tr>
%= t td => 'Start Time'
- %= t td => $client_info->{StartupTime}
+ %= t td => human_date_from_epoch($client_info->{StartupTime})
</tr>
<tr>
%= t td => 'Crash Time'
- %= t td => $client_info->{CrashTime}
+ %= t td => human_date_from_epoch($client_info->{CrashTime})
</tr>
<tr>
%= t td => 'Product'
--- a/templates/report/crash.html.ep Sun Feb 14 23:47:24 2016 +0100
+++ b/templates/report/crash.html.ep Sun Feb 14 23:56:24 2016 +0100
@@ -6,6 +6,8 @@
%= t h3 => (class => 'panel-title') => "Crash for $processed_data->{client_info}->{ProductName} $processed_data->{client_info}->{Version}"
% end
%= t div => (class => 'panel-body') => begin
+ %= "Crash Time: " . human_date_from_epoch($processed_data->{client_info}->{CrashTime});
+ <br/>
%= link_to "In crash group \"" . $crash_group->{title} . "\"" => url_for('group', uuid => $crash_group->{uuid})
% end
% end
--- a/templates/reports/index.atom.ep Sun Feb 14 23:47:24 2016 +0100
+++ b/templates/reports/index.atom.ep Sun Feb 14 23:56:24 2016 +0100
@@ -10,7 +10,7 @@
<entry>
<id>tag:crash,2014:uuid::<%= $crash->{uuid} =%></id>
<link type="text/html" rel="alternate" href="<%= url_for('report', uuid => $crash->{uuid})->to_abs =%>"/>
- <title><%= $crash->{p_name} =%> <%= $crash->{p_version} =%>: <%= $crash->{uuid} =%></title>
+ <title><%= $crash->{p_name} =%> <%= $crash->{p_version} =%>: <%= $crash->{uuid} =%></title>
<updated><%= date_with_tz_from_db_utc($crash->{crash_time}) =%></updated>
<published><%= date_with_tz_from_db_utc($crash->{crash_time}) =%></published>
<author>