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