diff --git a/composer.json b/composer.json index f1c0b2f4d50..79f7b2b9913 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "php": ">=5.5.0", "ext-intl": "*", "ext-mbstring": "*", - "nesbot/Carbon": "1.13.*", + "cakephp/chronos": "~1.0", "aura/intl": "1.1.*", "psr/log": "1.0" }, diff --git a/src/I18n/Time.php b/src/I18n/Time.php index 3f4935ebfd6..26afa095213 100644 --- a/src/I18n/Time.php +++ b/src/I18n/Time.php @@ -14,7 +14,7 @@ */ namespace Cake\I18n; -use Carbon\Carbon; +use Cake\Chronos\Chronos; use DateTime; use DateTimeZone; use IntlDateFormatter; @@ -25,7 +25,7 @@ * formatting helpers * */ -class Time extends Carbon implements JsonSerializable +class Time extends Chronos implements JsonSerializable { /** @@ -158,36 +158,6 @@ public function nice($timezone = null, $locale = null) return $this->i18nFormat(static::$niceFormat, $timezone, $locale); } - /** - * Returns true if this object represents a date within the current week - * - * @return bool - */ - public function isThisWeek() - { - return static::now($this->getTimezone())->format('W o') == $this->format('W o'); - } - - /** - * Returns true if this object represents a date within the current month - * - * @return bool - */ - public function isThisMonth() - { - return static::now($this->getTimezone())->format('m Y') == $this->format('m Y'); - } - - /** - * Returns true if this object represents a date within the current year - * - * @return bool - */ - public function isThisYear() - { - return static::now($this->getTimezone())->format('Y') == $this->format('Y'); - } - /** * Returns the quarter *