| @@ 110-122 (lines=13) @@ | ||
| 107 | return in_array($part, $m); |
|
| 108 | } |
|
| 109 | ||
| 110 | protected function testDay($part) |
|
| 111 | { |
|
| 112 | if (ctype_digit($part) && $part <= 31) { |
|
| 113 | return true; |
|
| 114 | } |
|
| 115 | $parse = date_parse($part); |
|
| 116 | if (!empty($parse) && $parse['day'] !== false && $parse['error_count'] == 0 ) { |
|
| 117 | return true; |
|
| 118 | } else if (preg_match('/^\d{1,2}[\/\\-]\d{1,2}[\/\\-]\d{1,2}$/', $part)) { |
|
| 119 | return true; |
|
| 120 | } |
|
| 121 | return false; |
|
| 122 | } |
|
| 123 | ||
| 124 | protected function testMonth($part) |
|
| 125 | { |
|
| @@ 124-136 (lines=13) @@ | ||
| 121 | return false; |
|
| 122 | } |
|
| 123 | ||
| 124 | protected function testMonth($part) |
|
| 125 | { |
|
| 126 | if (ctype_digit($part) && $part <= 12) { |
|
| 127 | return true; |
|
| 128 | } |
|
| 129 | $parse = date_parse($part); |
|
| 130 | if (!empty($parse) && $parse['month'] !== false && $parse['error_count'] == 0 ) { |
|
| 131 | return true; |
|
| 132 | } else if (preg_match('/^\d{1,2}[\/\\-]\d{1,2}[\/\\-]\d{1,2}$/', $part)) { |
|
| 133 | return true; |
|
| 134 | } |
|
| 135 | return false; |
|
| 136 | } |
|
| 137 | ||
| 138 | protected function testYear($part) |
|
| 139 | { |
|