@@ 169-181 (lines=13) @@ | ||
166 | * @param string $value |
|
167 | * @return void |
|
168 | */ |
|
169 | public function setOpenTimeAttribute($value) |
|
170 | { |
|
171 | //If the user is logged in then use there preferred timezone |
|
172 | if (Auth::check()) |
|
173 | { |
|
174 | $time = new Carbon($value, Auth::user()->timezone); |
|
175 | $time = $time->setTimezone('UTC'); |
|
176 | } else { |
|
177 | $time = new Carbon($value, 'UTC'); |
|
178 | } |
|
179 | ||
180 | $this->attributes[ 'open_time' ] = $time->format('H:i:s'); |
|
181 | } |
|
182 | ||
183 | /** |
|
184 | * Set the close time to UTC |
|
@@ 191-203 (lines=13) @@ | ||
188 | * @param string $value |
|
189 | * @return void |
|
190 | */ |
|
191 | public function setCloseTimeAttribute($value) |
|
192 | { |
|
193 | //If the user is logged in then use there preferred timezone |
|
194 | if (Auth::check()) |
|
195 | { |
|
196 | $time = new Carbon($value, Auth::user()->timezone); |
|
197 | $time = $time->setTimezone('UTC'); |
|
198 | } else { |
|
199 | $time = new Carbon($value, 'UTC'); |
|
200 | } |
|
201 | ||
202 | $this->attributes[ 'close_time' ] = $time->format('H:i:s'); |
|
203 | } |
|
204 | ||
205 | /** |
|
206 | * Accessor: Get the last time the server received an update call from the device in seconds/minutes/hours since |