This commit is contained in:
liukmqd@gmail.com
2011-04-18 08:44:00 +00:00
parent 23da695efe
commit 1beea76da8
10 changed files with 167 additions and 7 deletions
+36
View File
@@ -256,6 +256,28 @@ class todoModel extends model
return date(DT_DATE1, strtotime('yesterday'));
}
/**
* Get tomorrow.
*
* @access public
* @return date
*/
public function tomorrow()
{
return date(DT_DATE1, strtotime('tomorrow'));
}
/**
* Get the day before yesterday.
*
* @access public
* @return date
*/
public function twoDaysAgo()
{
return date(DT_DATE1, strtotime('-2 days'));
}
/**
* Get now time period.
*
@@ -362,4 +384,18 @@ class todoModel extends model
if($weekDay == 7) $baseTime = time() - 86400 * 10; // Make sure is last thursday.
return $baseTime;
}
public function getThisMonth()
{
$begin = date('Y-m');
$end = date('Y-m', strtotime('next month'));
return array('begin' => $begin, 'end' => $end);
}
public function getLastMonth()
{
$begin = date('Y-m', strtotime('last month'));
$end = date('Y-m', strtotime('this month'));
return array('begin' => $begin, 'end' => $end);
}
}