projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e0fb146
)
search for 'last month', RT#11057
author
mark
<mark>
Mon, 31 Jan 2011 23:59:16 +0000
(23:59 +0000)
committer
mark
<mark>
Mon, 31 Jan 2011 23:59:16 +0000
(23:59 +0000)
rt/lib/RT/Tickets_Overlay.pm
patch
|
blob
|
history
diff --git
a/rt/lib/RT/Tickets_Overlay.pm
b/rt/lib/RT/Tickets_Overlay.pm
index
e3658fe
..
16e98ae
100644
(file)
--- a/
rt/lib/RT/Tickets_Overlay.pm
+++ b/
rt/lib/RT/Tickets_Overlay.pm
@@
-539,16
+539,26
@@
sub _DateFieldLimit {
# 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.
# 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' ) {
my ($daystart, $dayend);
if ( lc($value) eq 'this month' ) {
- # special case: > and < the edges of this month
$date->SetToNow;
$date->SetToNow;
- $date->SetToStart('month');
+ $date->SetToStart('month'
, Timezone => 'server'
);
$daystart = $date->ISO;
$date->AddMonth;
$dayend = $date->ISO;
}
$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;
else {
$date->SetToMidnight( Timezone => 'server' );
$daystart = $date->ISO;