[freeside-commits] freeside/rt/lib/RT Tickets_Overlay.pm, 1.5.2.4, 1.5.2.5

Mark Wells mark at wavetail.420.am
Mon Jan 31 15:59:18 PST 2011


Update of /home/cvs/cvsroot/freeside/rt/lib/RT
In directory wavetail.420.am:/tmp/cvs-serv13329

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	Tickets_Overlay.pm 
Log Message:
search for 'last month', RT#11057

Index: Tickets_Overlay.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/lib/RT/Tickets_Overlay.pm,v
retrieving revision 1.5.2.4
retrieving revision 1.5.2.5
diff -u -w -d -r1.5.2.4 -r1.5.2.5
--- Tickets_Overlay.pm	28 Jan 2011 21:30:16 -0000	1.5.2.4
+++ Tickets_Overlay.pm	31 Jan 2011 23:59:16 -0000	1.5.2.5
@@ -539,16 +539,26 @@
         # if we're specifying =, that means we want everything on a
         # particular single day.  in the database, we need to check for >
         # and < the edges of that day.
+        #
+        # Except if the value is 'this month' or 'last month', check 
+        # > and < the edges of the month.
        
         my ($daystart, $dayend);
         if ( lc($value) eq 'this month' ) { 
-            # special case: > and < the edges of this month
             $date->SetToNow;
-            $date->SetToStart('month');
+            $date->SetToStart('month', Timezone => 'server');
             $daystart = $date->ISO;
             $date->AddMonth;
             $dayend = $date->ISO;
         }
+        elsif ( lc($value) eq 'last month' ) {
+            $date->SetToNow;
+            $date->SetToStart('month', Timezone => 'server');
+            $dayend = $date->ISO;
+            $date->AddDays(-1);
+            $date->SetToStart('month', Timezone => 'server');
+            $daystart = $date->ISO;
+        }
         else {
             $date->SetToMidnight( Timezone => 'server' );
             $daystart = $date->ISO;



More information about the freeside-commits mailing list