| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | public function convertToLocal( |
||
| 37 | ?Carbon $date, |
||
| 38 | ?string $format = null, |
||
| 39 | bool $displayTimezone = false |
||
| 40 | ): string { |
||
| 41 | $date = $this->toLocal($date); |
||
| 42 | |||
| 43 | if ($date === null) { |
||
| 44 | return config('timezone.empty_date', 'Empty'); |
||
| 45 | } |
||
| 46 | |||
| 47 | $formatted = $date->format($format ?? config('timezone.format', 'jS F Y g:i:a')); |
||
| 48 | |||
| 49 | if ($displayTimezone) { |
||
| 50 | return $formatted . ' ' . $this->formatTimezone($date); |
||
| 51 | } |
||
| 52 | |||
| 53 | return $formatted; |
||
| 54 | } |
||
| 61 |