[freeside-commits] freeside/rt/lib/RT Tickets_Overlay.pm,1.9,1.10
Mark Wells
mark at wavetail.420.am
Mon Jan 31 15:59:01 PST 2011
Update of /home/cvs/cvsroot/freeside/rt/lib/RT
In directory wavetail.420.am:/tmp/cvs-serv13239
Modified Files:
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.9
retrieving revision 1.10
diff -u -w -d -r1.9 -r1.10
--- Tickets_Overlay.pm 28 Jan 2011 21:30:06 -0000 1.9
+++ Tickets_Overlay.pm 31 Jan 2011 23:58:59 -0000 1.10
@@ -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