From 04c602e3d0dd8d71612415a421c16096d5fc8851 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 31 Dec 2010 16:37:16 -0500 Subject: [PATCH] Fixing issues with isThisWeek() when the year ends midweek. --- cake/libs/view/helpers/time.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php index f65b62de0..32e9e3050 100644 --- a/cake/libs/view/helpers/time.php +++ b/cake/libs/view/helpers/time.php @@ -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()); } /**