Skip to content

Commit 26f6bde

Browse files
Merge pull request #1450 from CachetHQ/incident-presenter-date-factory
Incident presenter date factory
2 parents ced993a + 50a7441 commit 26f6bde

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/Presenters/IncidentPresenter.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function created_at_formatted()
5959
*/
6060
public function created_at_datetimepicker()
6161
{
62-
return $this->wrappedObject->created_at->setTimezone(Config::get('cachet.timezone'))->format('d/m/Y H:i');
62+
return app(DateFactory::class)->make($this->wrappedObject->created_at)->format('d/m/Y H:i');
6363
}
6464

6565
/**
@@ -69,7 +69,7 @@ public function created_at_datetimepicker()
6969
*/
7070
public function created_at_iso()
7171
{
72-
return $this->wrappedObject->created_at->setTimezone(Config::get('cachet.timezone'))->toISO8601String();
72+
return app(DateFactory::class)->make($this->wrappedObject->created_at)->toISO8601String();
7373
}
7474

7575
/**
@@ -99,7 +99,7 @@ public function scheduled_at_diff()
9999
*/
100100
public function scheduled_at_formatted()
101101
{
102-
return ucfirst(app(DateFactory::class)->make($this->wrappedObject->created_at)->format(Config::get('setting.incident_date_format', 'l jS F Y H:i:s')));
102+
return ucfirst(app(DateFactory::class)->make($this->wrappedObject->scheduled_at)->format(Config::get('setting.incident_date_format', 'l jS F Y H:i:s')));
103103
}
104104

105105
/**
@@ -109,7 +109,7 @@ public function scheduled_at_formatted()
109109
*/
110110
public function scheduled_at_iso()
111111
{
112-
return $this->wrappedObject->scheduled_at->setTimezone(Config::get('cachet.timezone'))->toISO8601String();
112+
return app(DateFactory::class)->make($this->wrappedObject->scheduled_at)->toISO8601String();
113113
}
114114

115115
/**
@@ -119,7 +119,7 @@ public function scheduled_at_iso()
119119
*/
120120
public function scheduled_at_datetimepicker()
121121
{
122-
return $this->wrappedObject->scheduled_at->setTimezone(Config::get('cachet.timezone'))->format('d/m/Y H:i');
122+
return app(DateFactory::class)->make($this->wrappedObject->scheduled_at)->format('d/m/Y H:i');
123123
}
124124

125125
/**

0 commit comments

Comments
 (0)