Use the TimestampsTrait for the formatted incident date

This commit is contained in:
James Brooks
2016-12-03 19:36:55 +00:00
parent cb1b5378a8
commit 67df17d9e1
3 changed files with 3 additions and 6 deletions

View File

@@ -14,7 +14,6 @@ namespace CachetHQ\Cachet\Presenters;
use CachetHQ\Cachet\Dates\DateFactory;
use CachetHQ\Cachet\Presenters\Traits\TimestampsTrait;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Facades\Config;
use McCool\LaravelAutoPresenter\BasePresenter;
class ComponentPresenter extends BasePresenter implements Arrayable
@@ -69,7 +68,7 @@ class ComponentPresenter extends BasePresenter implements Arrayable
*/
public function updated_at_formatted()
{
return ucfirst(app(DateFactory::class)->make($this->wrappedObject->updated_at)->format(Config::get('setting.incident_date_format', 'l jS F Y H:i:s')));
return ucfirst(app(DateFactory::class)->make($this->wrappedObject->updated_at)->format($this->incidentDateFormat()));
}
/**

View File

@@ -15,7 +15,6 @@ use CachetHQ\Cachet\Dates\DateFactory;
use CachetHQ\Cachet\Presenters\Traits\TimestampsTrait;
use GrahamCampbell\Markdown\Facades\Markdown;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Facades\Config;
use McCool\LaravelAutoPresenter\BasePresenter;
/**
@@ -64,7 +63,7 @@ class IncidentUpdatePresenter extends BasePresenter implements Arrayable
*/
public function created_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->created_at)->format($this->incidentDateFormat()));
}
/**

View File

@@ -14,7 +14,6 @@ namespace CachetHQ\Cachet\Presenters;
use CachetHQ\Cachet\Dates\DateFactory;
use CachetHQ\Cachet\Presenters\Traits\TimestampsTrait;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Facades\Config;
use McCool\LaravelAutoPresenter\BasePresenter;
class SubscriberPresenter extends BasePresenter implements Arrayable
@@ -28,7 +27,7 @@ class SubscriberPresenter extends BasePresenter implements Arrayable
*/
public function verified_at()
{
return ucfirst(app(DateFactory::class)->make($this->wrappedObject->verified_at)->format(Config::get('setting.incident_date_format', 'l jS F Y H:i:s')));
return ucfirst(app(DateFactory::class)->make($this->wrappedObject->verified_at)->format($this->incidentDateFormat()));
}
/**