@@ 526-532 (lines=7) @@ | ||
523 | * @return EE_Base_Class return the EE_Base_Class object so right away you can do something with it |
|
524 | * (chaining) |
|
525 | */ |
|
526 | public static function date_time_add(EE_Base_Class $obj, $datetime_field_name, $period = 'years', $value = 1) |
|
527 | { |
|
528 | //get the raw UTC date. |
|
529 | $DateTime = $obj->get_DateTime_object($datetime_field_name); |
|
530 | $DateTime = EEH_DTT_Helper::calc_date($DateTime, $period, $value); |
|
531 | return EEH_DTT_Helper::_set_date_time_field($obj, $DateTime, $datetime_field_name); |
|
532 | } |
|
533 | ||
534 | ||
535 | /** |
|
@@ 545-551 (lines=7) @@ | ||
542 | * @param int $value |
|
543 | * @return \EE_Base_Class |
|
544 | */ |
|
545 | public static function date_time_subtract(EE_Base_Class $obj, $datetime_field_name, $period = 'years', $value = 1) |
|
546 | { |
|
547 | //get the raw UTC date |
|
548 | $DateTime = $obj->get_DateTime_object($datetime_field_name); |
|
549 | $DateTime = EEH_DTT_Helper::calc_date($DateTime, $period, $value, '-'); |
|
550 | return EEH_DTT_Helper::_set_date_time_field($obj, $DateTime, $datetime_field_name); |
|
551 | } |
|
552 | ||
553 | ||
554 | /** |