Author: nathangray
Date: Wed Apr 27 17:43:38 2016
New Revision: 55891
URL: http://svn.stylite.de/viewvc/egroupware?rev=55891&view=rev
Log:
Remove 1 week limit if end date is not provided
Modified:
trunk/egroupware/api/src/DateTime.php
Modified: trunk/egroupware/api/src/DateTime.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/src/DateTime.php?rev=55891&r1=55890&r2=55891&view=diff
==============================================================================
--- trunk/egroupware/api/src/DateTime.php (original)
+++ trunk/egroupware/api/src/DateTime.php Wed Apr 27 17:43:38 2016
@@ -228,11 +228,6 @@
$end->setTime(0, 0, 0);
$end->add('+1day');
}
- else
- {
- $end = new DateTime($start);
- $end->add('+1week');
- }
}
else
{
@@ -280,13 +275,19 @@
}
}
// convert start + end from user to servertime for the filter
- $sql = '('.DateTime::user2server($start, 'ts').' <= '.$column.' AND '.$column.' < '.DateTime::user2server($end, 'ts').')';
+ $sql = '('.DateTime::user2server($start, 'ts').' <= '.$column;
+ if($end)
+ {
+ $sql .=' AND '.$column.' < '.DateTime::user2server($end, 'ts');
+
+ // returned timestamps: $end is an inclusive date, eg. for today it's equal to start!
+ $end->add('-1day');
+ $end = $end->format('ts');
+ }
+ $sql .= ')';
//error_log(__METHOD__."('$name', ...) syear=$syear, smonth=$smonth, sday=$sday, sweek=$sweek, eyear=$eyear, emonth=$emonth, eday=$eday, eweek=$eweek --> start=".$start->format().', end='.$end->format().", sql='$sql'");
- // returned timestamps: $end is an inclusive date, eg. for today it's equal to start!
$start = $start->format('ts');
- $end->add('-1day');
- $end = $end->format('ts');
return $sql;
}
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.