You are here

function _simplenews_scheduler_make_time_offset in Simplenews Scheduler 6.2

Same name and namespace in other branches
  1. 8 simplenews_scheduler.module \_simplenews_scheduler_make_time_offset()
  2. 7 simplenews_scheduler.module \_simplenews_scheduler_make_time_offset()
  3. 2.0.x simplenews_scheduler.module \_simplenews_scheduler_make_time_offset()

Helper to create a PHP time offset string.

Parameters

$interval: A time interval. One of hour, day, week, month.

$frequency: An integer that specifies how many of the $interval to create an offset for.

Return value

A string representing a time offset that can be understood by strtotime(), eg '+1 month'.

3 calls to _simplenews_scheduler_make_time_offset()
SimpleNewsSchedulerNextRunTimeTest::testNextRunTimeOneMonth in tests/simplenews_scheduler.test
Test a frequency of 1 month.
simplenews_scheduler_calculate_edition_time in ./simplenews_scheduler.module
Calculates time for the current edition about to be created.
simplenews_scheduler_calculate_next_run_time in ./simplenews_scheduler.module
Calculates time for the next edition to be sent.

File

./simplenews_scheduler.module, line 471
Simplenews Scheduler module allows a schedule to be set for sending (and resending) a Simplenews item.

Code

function _simplenews_scheduler_make_time_offset($interval, $frequency) {
  $offset_string = "+{$frequency} {$interval}";
  return $offset_string;
}