Skip to content

Commit

Permalink
Fixing issues with isThisWeek() when the year ends midweek.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 31, 2010
1 parent 1f6fba9 commit 04c602e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cake/libs/view/helpers/time.php
Expand Up @@ -282,7 +282,8 @@ public function isToday($dateString, $userOffset = null) {
}

/**
* 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
Expand All @@ -291,7 +292,7 @@ public function isToday($dateString, $userOffset = null) {
*/
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());
}

/**
Expand Down

0 comments on commit 04c602e

Please sign in to comment.