| @@ 60-76 (lines=17) @@ | ||
| 57 | * @return self |
|
| 58 | * @throws InvalidArgumentException |
|
| 59 | */ |
|
| 60 | public function withMinDate($date) |
|
| 61 | { |
|
| 62 | if ($date instanceof Carbon) |
|
| 63 | { |
|
| 64 | $this->date_min = $date->format($this->date_format); |
|
| 65 | } |
|
| 66 | else if (is_string($date)) |
|
| 67 | { |
|
| 68 | $this->date_min = $date; |
|
| 69 | } |
|
| 70 | else |
|
| 71 | { |
|
| 72 | throw new InvalidArgumentException("Min date must be a string or a Carbon instance."); |
|
| 73 | } |
|
| 74 | ||
| 75 | return $this; |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * @param string|Carbon $date |
|
| @@ 83-99 (lines=17) @@ | ||
| 80 | * @return self |
|
| 81 | * @throws InvalidArgumentException |
|
| 82 | */ |
|
| 83 | public function withMaxDate($date) |
|
| 84 | { |
|
| 85 | if ($date instanceof Carbon) |
|
| 86 | { |
|
| 87 | $this->date_max = $date->format($this->date_format); |
|
| 88 | } |
|
| 89 | else if (is_string($date)) |
|
| 90 | { |
|
| 91 | $this->date_max = $date; |
|
| 92 | } |
|
| 93 | else |
|
| 94 | { |
|
| 95 | throw new InvalidArgumentException("Max date must be a string or a Carbon instance."); |
|
| 96 | } |
|
| 97 | ||
| 98 | return $this; |
|
| 99 | } |
|
| 100 | ||
| 101 | /** |
|
| 102 | * @param void |
|