mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Fixing issues with isThisWeek() when the year ends midweek.
This commit is contained in:
parent
1f6fba9d9e
commit
04c602e3d0
1 changed files with 3 additions and 2 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue