|
@@ 235-245 (lines=11) @@
|
| 232 |
|
* @param $value string |
| 233 |
|
* @return object |
| 234 |
|
*/ |
| 235 |
|
public function add( $value ) { |
| 236 |
|
|
| 237 |
|
$this->date_interval_expression = str_replace( $this->config['date_simple'], $this->config['date_interval'], $value ); |
| 238 |
|
|
| 239 |
|
$this->date_interval_expression = str_replace( ' ', '', 'P' . $this->date_interval_expression ); |
| 240 |
|
|
| 241 |
|
$this->date_time->add( new DateInterval( $this->date_interval_expression ) ); |
| 242 |
|
|
| 243 |
|
return $this; |
| 244 |
|
|
| 245 |
|
} |
| 246 |
|
|
| 247 |
|
/** |
| 248 |
|
* Sub date from current date |
|
@@ 252-262 (lines=11) @@
|
| 249 |
|
* @param $value |
| 250 |
|
* @return obejct |
| 251 |
|
*/ |
| 252 |
|
public function sub( $value ) { |
| 253 |
|
|
| 254 |
|
$this->date_interval_expression = str_replace( $this->config['date_simple'], $this->config['date_interval'], $value ); |
| 255 |
|
|
| 256 |
|
$this->date_interval_expression = str_replace( ' ', '', 'P' . $this->date_interval_expression ); |
| 257 |
|
|
| 258 |
|
$this->date_time->sub( new DateInterval( $this->date_interval_expression ) ); |
| 259 |
|
|
| 260 |
|
return $this; |
| 261 |
|
|
| 262 |
|
} |
| 263 |
|
|
| 264 |
|
/** |
| 265 |
|
* Check if current year is leap or not |