Skip to content

Commit

Permalink
Update TimeHelper docs.
Browse files Browse the repository at this point in the history
Refs #4133
  • Loading branch information
markstory committed Aug 4, 2014
1 parent d1f55ca commit 1c79850
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/View/Helper/TimeHelper.php
Expand Up @@ -108,15 +108,15 @@ public function isThisWeek($dateString, $timezone = null) {
*
* @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
* @return bool True if datetime string is within current month
* @return bool True if datetime string is within the current month
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
*/
public function isThisMonth($dateString, $timezone = null) {
return (new Time($dateString, $timezone))->isThisMonth();
}

/**
* Returns true if given datetime string is within current year.
* Returns true if given datetime string is within the current year.
*
* @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
Expand Down Expand Up @@ -166,7 +166,7 @@ public function toQuarter($dateString, $range = false) {
}

/**
* Returns a UNIX timestamp from a textual datetime description. Wrapper for PHP function strtotime().
* Returns a UNIX timestamp from a textual datetime description.
*
* @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
Expand Down Expand Up @@ -206,7 +206,7 @@ public function toRSS($dateString, $timezone = null) {
}

/**
* Formats date for RSS feeds
* Formats a date into a phrase expressing the relative time.
*
* ## Additional options
*
Expand Down Expand Up @@ -276,7 +276,7 @@ public function wasWithinLast($timeInterval, $dateString, $timezone = null) {
* @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
* @return bool
* @see \Cake\Utility\Time::isWithinLast()
* @see \Cake\Utility\Time::wasWithinLast()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
*/
public function isWithinNext($timeInterval, $dateString, $timezone = null) {
Expand All @@ -297,6 +297,7 @@ public function gmt($string = null) {

/**
* Returns a formatted date string, given either a UNIX timestamp or a valid strtotime() date string.
*
* This function also accepts a time string and a format string as first and second parameters.
* In that case this function behaves as a wrapper for Time::i18nFormat()
*
Expand All @@ -314,7 +315,8 @@ public function format($date, $format = null, $invalid = false, $timezone = null

/**
* Returns a formatted date string, given either a UNIX timestamp or a valid strtotime() date string.
* It takes into account the default date format for the current language if a LC_TIME file is used.
*
* This method takes into account the default date format for the current language if an LC_TIME file is used.
*
* @param int|string|\DateTime $date UNIX timestamp, strtotime() valid string or DateTime object
* @param string $format strftime format string.
Expand Down

0 comments on commit 1c79850

Please sign in to comment.