Fixing issues with isThisWeek() when the year ends midweek.

This commit is contained in:
mark_story 2010-12-31 16:37:16 -05:00
parent 1f6fba9d9e
commit 04c602e3d0

View file

@ -282,7 +282,8 @@ class TimeHelper extends AppHelper {
}
/**
* Returns true if given datetime string is within this week
* Returns true if given datetime string is within this week.
*
* @param string $dateString
* @param int $userOffset User's offset from GMT (in hours)
* @return boolean True if datetime string is within current week
@ -291,7 +292,7 @@ class TimeHelper extends AppHelper {
*/
public function isThisWeek($dateString, $userOffset = null) {
$date = $this->fromString($dateString, $userOffset);
return date('W Y', $date) == date('W Y', time());
return date('W o', $date) == date('W o', time());
}
/**