| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 42 | public function convertToLocalDiffForHumans(?Carbon $date): string |
||
| 43 | { |
||
| 44 | if (is_null($date)) { |
||
| 45 | return 'Empty'; |
||
| 46 | } |
||
| 47 | |||
| 48 | $timezone = (auth()->user()->timezone) ?? config('app.timezone'); |
||
| 49 | |||
| 50 | $date->setTimezone($timezone); |
||
| 51 | |||
| 52 | $diffTime = Carbon::parse($date)->diffForHumans(); |
||
| 53 | |||
| 54 | return $diffTime; |
||
| 55 | } |
||
| 82 |