* adjust code format.
* add latest3days period param.
This commit is contained in:
@@ -477,7 +477,7 @@ class actionModel extends model
|
||||
/**
|
||||
* Compute the begin date and end date of a period.
|
||||
*
|
||||
* @param string $period
|
||||
* @param string $period all|today|yesterday|twodaysago|latest2days|thisweek|lastweek|thismonth|lastmonth
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -490,10 +490,13 @@ class actionModel extends model
|
||||
$yesterday = $this->todo->yesterday();
|
||||
$twoDaysAgo = $this->todo->twoDaysAgo();
|
||||
|
||||
$period = strtolower($period);
|
||||
|
||||
if($period == 'all') return array('begin' => '1970-1-1', 'end' => '2109-1-1');
|
||||
if($period == 'today') return array('begin' => $today, 'end' => $tomorrow);
|
||||
if($period == 'yesterday') return array('begin' => $yesterday, 'end' => $today);
|
||||
if($period == 'twodaysago') return array('begin' => $twoDaysAgo, 'end' => $yesterday);
|
||||
if($period == 'latest3days')return array('begin' => $twoDaysAgo, 'end' => $tomorrow);
|
||||
|
||||
/* If the period is by week, add the end time to the end date. */
|
||||
if($period == 'thisweek' or $period == 'lastweek')
|
||||
|
||||
Reference in New Issue
Block a user