diff options
author | mark <mark> | 2011-01-28 21:30:06 +0000 |
---|---|---|
committer | mark <mark> | 2011-01-28 21:30:06 +0000 |
commit | ca5ea1f2105485d640cc68f99954b683de997561 (patch) | |
tree | cafaf2357cd55c65ef42a364c160678b963c5310 /rt/lib/RT/Tickets_Overlay.pm | |
parent | 539f3fc974a3b4ebf3fd23e497f29829f9db51c4 (diff) |
ticket search for "this month", RT#11057
Diffstat (limited to 'rt/lib/RT/Tickets_Overlay.pm')
-rw-r--r-- | rt/lib/RT/Tickets_Overlay.pm | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/rt/lib/RT/Tickets_Overlay.pm b/rt/lib/RT/Tickets_Overlay.pm index 89d64c557..e3658fee6 100644 --- a/rt/lib/RT/Tickets_Overlay.pm +++ b/rt/lib/RT/Tickets_Overlay.pm @@ -539,11 +539,22 @@ 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. - - $date->SetToMidnight( Timezone => 'server' ); - my $daystart = $date->ISO; - $date->AddDay; - my $dayend = $date->ISO; + + my ($daystart, $dayend); + if ( lc($value) eq 'this month' ) { + # special case: > and < the edges of this month + $date->SetToNow; + $date->SetToStart('month'); + $daystart = $date->ISO; + $date->AddMonth; + $dayend = $date->ISO; + } + else { + $date->SetToMidnight( Timezone => 'server' ); + $daystart = $date->ISO; + $date->AddDay; + $dayend = $date->ISO; + } $sb->_OpenParen; |