From 336b9dcac13844a3d127b928a600bfb27e57e309 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Fri, 26 Dec 2014 21:52:04 -0700 Subject: [PATCH] Date math --- lib/Lacuna/DB/Result/Ships.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Lacuna/DB/Result/Ships.pm b/lib/Lacuna/DB/Result/Ships.pm index 72c46a01..325a6861 100644 --- a/lib/Lacuna/DB/Result/Ships.pm +++ b/lib/Lacuna/DB/Result/Ships.pm @@ -404,7 +404,8 @@ sub send { my %ag_hash = map { $_ => $cnt++ } @ag_list; my $now = DateTime->now; - my $seconds2arrive = $self->seconds_remaining; + my $time2arrive = $now->subtract_datetime_absolute($self->date_available); + my $seconds2arrive = $time2arrive->seconds; if ($seconds2arrive > 1200 && grep { $self->type eq $_ } @ag_list) { # Only consolidate if ships take longer than 20 minutes my $dtf = Lacuna->db->storage->datetime_parser; my $start_range = $now->add(seconds => ($seconds2arrive - 900)); -- 2.51.2