Skip to content

Commit 2f5af6f

Browse files
committed
Removing default guayaquil timezone
1 parent 33ecd0d commit 2f5af6f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Controller.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class Controller extends WebController
1717
*/
1818
public function beforeAction($action)
1919
{
20-
date_default_timezone_set("America/Guayaquil");
2120
Yii::$app->response->format = Response::FORMAT_JSON;
2221
Yii::$app->response->headers->add('Content-Type', 'application/json');
2322
$this->enableCsrfValidation = false;
@@ -30,13 +29,19 @@ public function beforeAction($action)
3029
public function afterAction($action, $result)
3130
{
3231
$result = parent::afterAction($action, $result);
33-
if (is_null($result)) Yii::$app->response->content = '';
32+
if (is_null($result)) {
33+
Yii::$app->response->content = '';
34+
}
3435

3536
// Si no es un strign no validamos nada
36-
if (!is_string($result)) return $result;
37+
if (!is_string($result)) {
38+
return $result;
39+
}
3740

3841
if (($data = json_decode($result)) !== false) {
39-
if (is_object($data)) return $data;
42+
if (is_object($data)) {
43+
return $data;
44+
}
4045
}
4146

4247
// Si es un PDF lo mostramos ya no seteamos a json

0 commit comments

Comments
 (0)