|
@@ 127-135 (lines=9) @@
|
| 124 |
|
* |
| 125 |
|
* @return \AlgoWeb\xsdTypes\AxillaryClasses\Calender |
| 126 |
|
*/ |
| 127 |
|
public static function fromMonthDay($monthDay) |
| 128 |
|
{ |
| 129 |
|
$re = '/--(1[0-2]|0[1-9]|[1-9])-(0[1-9]|1[0-9]|2[0-9]|3[0-1]|[1-9])([-+][0-1]\d:[0-6]\d|Z*)/'; |
| 130 |
|
preg_match_all($re, $monthDay, $matches, PREG_SET_ORDER, 0); |
| 131 |
|
if (count($matches) != 1 && count($matches[0]) != 4) { |
| 132 |
|
throw new \InvalidArgumentException('Unable to extract month day from input string'); |
| 133 |
|
} |
| 134 |
|
return new self(null, $matches[0][1], $matches[0][2], $matches[0][3]); |
| 135 |
|
} |
| 136 |
|
|
| 137 |
|
/** |
| 138 |
|
* @param string $month |
|
@@ 157-165 (lines=9) @@
|
| 154 |
|
* |
| 155 |
|
* @return \AlgoWeb\xsdTypes\AxillaryClasses\Calender |
| 156 |
|
*/ |
| 157 |
|
public static function fromYearMonth($yearMonth) |
| 158 |
|
{ |
| 159 |
|
$re = '/(\d{4})-(1[0-2]|0[1-9]|[1-9])([-+][0-1]\d:[0-6]\d|Z*)/'; |
| 160 |
|
preg_match_all($re, $yearMonth, $matches, PREG_SET_ORDER, 0); |
| 161 |
|
if (count($matches) != 1 && count($matches[0]) != 3) { |
| 162 |
|
throw new \InvalidArgumentException('Unable to extract month from input string'); |
| 163 |
|
} |
| 164 |
|
return new self($matches[0][1], null, $matches[0][2], $matches[0][3]); |
| 165 |
|
} |
| 166 |
|
|
| 167 |
|
/** |
| 168 |
|
* @param string $year |