[Rt-commit] rt branch, 3.999-trunk, updated. af525c71ca4397beabb31762ed5cc4b45089fd71
sartak at bestpractical.com
sartak at bestpractical.com
Thu Nov 5 15:23:44 EST 2009
The branch, 3.999-trunk has been updated
via af525c71ca4397beabb31762ed5cc4b45089fd71 (commit)
via 281dd66cc9037be26b96bb62e12ceccc8213f1dc (commit)
from 677590506c21a1045a8e4341ff3bb290593b36fb (commit)
Summary of changes:
lib/RT/DateTime.pm | 3 +++
share/html/Ticket/Elements/ShowDates | 2 +-
2 files changed, 4 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit 281dd66cc9037be26b96bb62e12ceccc8213f1dc
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Thu Nov 5 15:22:38 2009 -0500
Methods for whether an RT::DateTime is in the past or future
diff --git a/lib/RT/DateTime.pm b/lib/RT/DateTime.pm
index 5347dcb..c374fab 100644
--- a/lib/RT/DateTime.pm
+++ b/lib/RT/DateTime.pm
@@ -150,5 +150,8 @@ sub is_set { not (shift->is_unset(@_)) }
sub new_unset { RT::DateTime->from_epoch(epoch => 0) }
+sub is_in_past { time > shift->epoch }
+sub is_in_future { shift->epoch > time }
+
1;
commit af525c71ca4397beabb31762ed5cc4b45089fd71
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Thu Nov 5 15:23:07 2009 -0500
Avoid confusing $date->diff logic
diff --git a/share/html/Ticket/Elements/ShowDates b/share/html/Ticket/Elements/ShowDates
index a5ed790..e785fe3 100755
--- a/share/html/Ticket/Elements/ShowDates
+++ b/share/html/Ticket/Elements/ShowDates
@@ -65,7 +65,7 @@
<tr>
<td class="label date due"><&|/l&>Due</&>:</td>
% my $due = $ticket->due;
-% if ( $due && $due->epoch > 0 && $due->diff < 0 ) {
+% if ( $due && $due->epoch > 0 && $due->is_in_past ) {
<td class="value date due"><span class="overdue"><% $due %></span></td>
% } else {
<td class="value date due"><% $due %></td>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list