Switch to the DateFactory. Closes #1444

This commit is contained in:
James Brooks
2016-02-05 09:30:37 +00:00
parent ced993af1f
commit 50a7441808
+5 -5
View File
@@ -59,7 +59,7 @@ class IncidentPresenter extends BasePresenter implements Arrayable
*/ */
public function created_at_datetimepicker() public function created_at_datetimepicker()
{ {
return $this->wrappedObject->created_at->setTimezone(Config::get('cachet.timezone'))->format('d/m/Y H:i'); return app(DateFactory::class)->make($this->wrappedObject->created_at)->format('d/m/Y H:i');
} }
/** /**
@@ -69,7 +69,7 @@ class IncidentPresenter extends BasePresenter implements Arrayable
*/ */
public function created_at_iso() public function created_at_iso()
{ {
return $this->wrappedObject->created_at->setTimezone(Config::get('cachet.timezone'))->toISO8601String(); return app(DateFactory::class)->make($this->wrappedObject->created_at)->toISO8601String();
} }
/** /**
@@ -99,7 +99,7 @@ class IncidentPresenter extends BasePresenter implements Arrayable
*/ */
public function scheduled_at_formatted() public function scheduled_at_formatted()
{ {
return ucfirst(app(DateFactory::class)->make($this->wrappedObject->created_at)->format(Config::get('setting.incident_date_format', 'l jS F Y H:i:s'))); return ucfirst(app(DateFactory::class)->make($this->wrappedObject->scheduled_at)->format(Config::get('setting.incident_date_format', 'l jS F Y H:i:s')));
} }
/** /**
@@ -109,7 +109,7 @@ class IncidentPresenter extends BasePresenter implements Arrayable
*/ */
public function scheduled_at_iso() public function scheduled_at_iso()
{ {
return $this->wrappedObject->scheduled_at->setTimezone(Config::get('cachet.timezone'))->toISO8601String(); return app(DateFactory::class)->make($this->wrappedObject->scheduled_at)->toISO8601String();
} }
/** /**
@@ -119,7 +119,7 @@ class IncidentPresenter extends BasePresenter implements Arrayable
*/ */
public function scheduled_at_datetimepicker() public function scheduled_at_datetimepicker()
{ {
return $this->wrappedObject->scheduled_at->setTimezone(Config::get('cachet.timezone'))->format('d/m/Y H:i'); return app(DateFactory::class)->make($this->wrappedObject->scheduled_at)->format('d/m/Y H:i');
} }
/** /**