Skip to content

Commit

Permalink
Start integrating chronos.
Browse files Browse the repository at this point in the history
* Update composer.json
* Remove methods defined in chronos.
  • Loading branch information
markstory committed Nov 6, 2015
1 parent a4076bc commit 637eb9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 33 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -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"
},
Expand Down
34 changes: 2 additions & 32 deletions src/I18n/Time.php
Expand Up @@ -14,7 +14,7 @@
*/
namespace Cake\I18n;

use Carbon\Carbon;
use Cake\Chronos\Chronos;
use DateTime;
use DateTimeZone;
use IntlDateFormatter;
Expand All @@ -25,7 +25,7 @@
* formatting helpers
*
*/
class Time extends Carbon implements JsonSerializable
class Time extends Chronos implements JsonSerializable
{

/**
Expand Down Expand Up @@ -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
*
Expand Down

0 comments on commit 637eb9e

Please sign in to comment.