1 | <?php |
||
18 | trait HasRanges |
||
19 | { |
||
20 | /* ----------------------------------------------------------------- |
||
21 | | Other Methods |
||
22 | | ----------------------------------------------------------------- |
||
23 | */ |
||
24 | |||
25 | /** |
||
26 | * Convert the ranges for json serialization. |
||
27 | * |
||
28 | * @return array |
||
29 | */ |
||
30 | 8 | public function rangesToArray(): array |
|
38 | |||
39 | /** |
||
40 | * Calculate the current range. |
||
41 | * |
||
42 | * @param int $range |
||
43 | * @param \DateTimeZone|string|null $timezone |
||
44 | * |
||
45 | * @return array |
||
46 | */ |
||
47 | 28 | protected function currentRange(int $range, $timezone): array |
|
54 | |||
55 | /** |
||
56 | * Calculate the previous range. |
||
57 | * |
||
58 | * @param int $range |
||
59 | * @param \DateTimeZone|string|null $timezone |
||
60 | * |
||
61 | * @return array |
||
62 | */ |
||
63 | 28 | protected function previousRange(int $range, $timezone): array |
|
70 | |||
71 | /** |
||
72 | * Get the current timezone. |
||
73 | * |
||
74 | * @param \Illuminate\Http\Request $request |
||
75 | * |
||
76 | * @return \DateTimeZone|string|null |
||
77 | */ |
||
78 | 56 | protected function getCurrentTimezone(Request $request) |
|
82 | } |
||
83 |