@@ -107,8 +107,9 @@ discard block |
||
107 | 107 | $time = new Carbon($value, 'UTC'); |
108 | 108 | |
109 | 109 | //If the user is logged in then use there preferred timezone |
110 | - if (Auth::check()) |
|
111 | - $time = $time->setTimezone(Auth::user()->timezone); |
|
110 | + if (Auth::check()) { |
|
111 | + $time = $time->setTimezone(Auth::user()->timezone); |
|
112 | + } |
|
112 | 113 | |
113 | 114 | return $time->format('H:i'); |
114 | 115 | } |
@@ -126,8 +127,9 @@ discard block |
||
126 | 127 | $time = new Carbon($value, 'UTC'); |
127 | 128 | |
128 | 129 | //If the user is logged in then use there preferred timezone |
129 | - if (Auth::check()) |
|
130 | - $time = $time->setTimezone(Auth::user()->timezone); |
|
130 | + if (Auth::check()) { |
|
131 | + $time = $time->setTimezone(Auth::user()->timezone); |
|
132 | + } |
|
131 | 133 | |
132 | 134 | return $time->format('H:i'); |
133 | 135 | } |
@@ -147,9 +149,9 @@ discard block |
||
147 | 149 | { |
148 | 150 | $time = new Carbon($value, Auth::user()->timezone); |
149 | 151 | $time = $time->setTimezone('UTC'); |
152 | + } else { |
|
153 | + $time = new Carbon($value, 'UTC'); |
|
150 | 154 | } |
151 | - else |
|
152 | - $time = new Carbon($value, 'UTC'); |
|
153 | 155 | |
154 | 156 | $this->attributes['open_time'] = $time->format('H:i:s'); |
155 | 157 | } |
@@ -169,9 +171,9 @@ discard block |
||
169 | 171 | { |
170 | 172 | $time = new Carbon($value, Auth::user()->timezone); |
171 | 173 | $time = $time->setTimezone('UTC'); |
174 | + } else { |
|
175 | + $time = new Carbon($value, 'UTC'); |
|
172 | 176 | } |
173 | - else |
|
174 | - $time = new Carbon($value, 'UTC'); |
|
175 | 177 | |
176 | 178 | $this->attributes['close_time'] = $time->format('H:i:s'); |
177 | 179 | } |
@@ -282,9 +284,10 @@ discard block |
||
282 | 284 | $time_now = Carbon::now($timezone); |
283 | 285 | |
284 | 286 | //Check if the current time is during the open schedule or not |
285 | - if ($time_now->gt($open_time) && $time_now->lt($close_time)) |
|
286 | - return true; |
|
287 | - else |
|
288 | - return false; |
|
287 | + if ($time_now->gt($open_time) && $time_now->lt($close_time)) { |
|
288 | + return true; |
|
289 | + } else { |
|
290 | + return false; |
|
291 | + } |
|
289 | 292 | } |
290 | 293 | } |