You are here

function interval_rules_apply_interval in Interval Field 7

Same name and namespace in other branches
  1. 8 interval.rules.inc \interval_rules_apply_interval()

Rules action callback: Apply an interval to a date.

1 string reference to 'interval_rules_apply_interval'
interval_rules_action_info in ./interval.rules.inc
Implements hook_rules_action_info().

File

./interval.rules.inc, line 58
Provides rules integration for interval module @copyright Copyright(c) 2011 Lee Rowlands @license GPL v2+ http://www.fsf.org/licensing/licenses/gpl.html @author Lee Rowlands contact at rowlandsgroup dot com

Code

function interval_rules_apply_interval($interval, $period, $datestamp, $limit = FALSE) {
  $date = new DateObject("@{$datestamp}");
  $item = array(
    'interval' => $interval,
    'period' => $period,
  );
  interval_apply_interval($date, $item, $limit);
  return array(
    'date' => $date
      ->format('U'),
  );
}