Function __global->get_calendar_event_first_date

Definitions

sources/calendar.php

  • Find details of when an event happens. Preferably the next recurrence, but if it is in the past, the first.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$timezone ?ID_TEXT No No required parameter N/A N/A The timezone of the event (null: current user's timezone)
$do_timezone_conv BINARY No No required parameter N/A N/A Whether the time should be converted to the viewer's own timezone
$start_year integer No No required parameter N/A N/A The year the event starts at. This and the below are in server time
$start_month integer No No required parameter N/A N/A The month the event starts at
$start_day integer No No required parameter N/A N/A The day the event starts at
$start_monthly_spec_type ID_TEXT No No required parameter day_of_month day_of_month_backwards dow_of_month dow_of_month_backwards N/A In-month specification type for start date
$start_hour ?integer No No required parameter N/A N/A The hour the event starts at (null: all day event)
$start_minute ?integer No No required parameter N/A N/A The minute the event starts at (null: all day event)
$end_year ?integer No No required parameter N/A N/A The year the event ends at (null: not a multi day event)
$end_month ?integer No No required parameter N/A N/A The month the event ends at (null: not a multi day event)
$end_day ?integer No No required parameter N/A N/A The day the event ends at (null: not a multi day event)
$end_monthly_spec_type ID_TEXT No No required parameter day_of_month day_of_month_backwards dow_of_month dow_of_month_backwards N/A In-month specification type for end date
$end_hour ?integer No No required parameter N/A N/A The hour the event ends at (null: not a multi day event / all day event)
$end_minute ?integer No No required parameter N/A N/A The minute the event ends at (null: not a multi day event / all day event)
$recurrence string No No required parameter N/A N/A The event recurrence
$recurrences ?integer No No required parameter N/A N/A The number of recurrences (null: none/infinite)
$force_first boolean No No False N/A N/A Whether to forcibly get the first recurrence, not a future one

Returns

  • A tuple: Written date [range], from timestamp, to timestamp
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Find details of when an event happens. Preferably the next recurrence, but if it is in the past, the first.
 *
 * @param  ?ID_TEXT $timezone The timezone of the event (null: current user's timezone)
 * @param  BINARY $do_timezone_conv Whether the time should be converted to the viewer's own timezone
 * @param  integer $start_year The year the event starts at. This and the below are in server time
 * @param  integer $start_month The month the event starts at
 * @param  integer $start_day The day the event starts at
 * @param  ID_TEXT $start_monthly_spec_type In-month specification type for start date
 * @set day_of_month day_of_month_backwards dow_of_month dow_of_month_backwards
 * @param  ?integer $start_hour The hour the event starts at (null: all day event)
 * @param  ?integer $start_minute The minute the event starts at (null: all day event)
 * @param  ?integer $end_year The year the event ends at (null: not a multi day event)
 * @param  ?integer $end_month The month the event ends at (null: not a multi day event)
 * @param  ?integer $end_day The day the event ends at (null: not a multi day event)
 * @param  ID_TEXT $end_monthly_spec_type In-month specification type for end date
 * @set day_of_month day_of_month_backwards dow_of_month dow_of_month_backwards
 * @param  ?integer $end_hour The hour the event ends at (null: not a multi day event / all day event)
 * @param  ?integer $end_minute The minute the event ends at (null: not a multi day event / all day event)
 * @param  string $recurrence The event recurrence
 * @param  ?integer $recurrences The number of recurrences (null: none/infinite)
 * @param  boolean $force_first Whether to forcibly get the first recurrence, not a future one
 * @return array A tuple: Written date [range], from timestamp, to timestamp
 */

function get_calendar_event_first_date(?string $timezone, int $do_timezone_conv, int $start_year, int $start_month, int $start_day, string $start_monthly_spec_type, ?int $start_hour, ?int $start_minute, ?int $end_year, ?int $end_month, ?int $end_day, string $end_monthly_spec_type, ?int $end_hour, ?int $end_minute, string $recurrence, ?int $recurrences, bool $force_first = false) : array