|
@@ 119-127 (lines=9) @@
|
| 116 |
|
* |
| 117 |
|
* @return \AlgoWeb\xsdTypes\AxillaryClasses\Calender |
| 118 |
|
*/ |
| 119 |
|
public static function fromMonthDay($monthDay) |
| 120 |
|
{ |
| 121 |
|
$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*)/'; |
| 122 |
|
preg_match_all($re, $monthDay, $matches, PREG_SET_ORDER, 0); |
| 123 |
|
if (count($matches) != 1 && count($matches[0]) != 4) { |
| 124 |
|
throw new \InvalidArgumentException('Unable to extract month day from input string'); |
| 125 |
|
} |
| 126 |
|
return new self(null, $matches[0][1], $matches[0][2], $matches[0][3]); |
| 127 |
|
} |
| 128 |
|
|
| 129 |
|
/** |
| 130 |
|
* @param string $month |
|
@@ 149-157 (lines=9) @@
|
| 146 |
|
* |
| 147 |
|
* @return \AlgoWeb\xsdTypes\AxillaryClasses\Calender |
| 148 |
|
*/ |
| 149 |
|
public static function fromYearMonth($yearMonth) |
| 150 |
|
{ |
| 151 |
|
$re = '/(\d{4})-(1[0-2]|0[1-9]|[1-9])([-+][0-1]\d:[0-6]\d|Z*)/'; |
| 152 |
|
preg_match_all($re, $yearMonth, $matches, PREG_SET_ORDER, 0); |
| 153 |
|
if (count($matches) != 1 && count($matches[0]) != 3) { |
| 154 |
|
throw new \InvalidArgumentException('Unable to extract month from input string'); |
| 155 |
|
} |
| 156 |
|
return new self($matches[0][1], null, $matches[0][2], $matches[0][3]); |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
/** |
| 160 |
|
* @param string $year |