| @@ 118-124 (lines=7) @@ | ||
| 115 | * |
|
| 116 | * @return string |
|
| 117 | */ |
|
| 118 | public function getOpenTimeHumanAttribute() |
|
| 119 | { |
|
| 120 | $time = new Carbon($this->attributes['open_time'], 'UTC'); |
|
| 121 | $time = $time->setTimezone(Auth::user()->timezone); |
|
| 122 | ||
| 123 | return $time->format('h:i a'); |
|
| 124 | } |
|
| 125 | ||
| 126 | /** |
|
| 127 | * Accessor: Get the close time of the device converted to hours and minutes |
|
| @@ 151-157 (lines=7) @@ | ||
| 148 | * |
|
| 149 | * @return string |
|
| 150 | */ |
|
| 151 | public function getCloseTimeHumanAttribute() |
|
| 152 | { |
|
| 153 | $time = new Carbon($this->attributes['close_time'], 'UTC'); |
|
| 154 | $time = $time->setTimezone(Auth::user()->timezone); |
|
| 155 | ||
| 156 | return $time->format('h:i a'); |
|
| 157 | } |
|
| 158 | ||
| 159 | /** |
|
| 160 | * Set the open time to UTC |
|