Semantic MediaWiki and related extensions
Static Public Member Functions | List of all members
SRFParserFunctions Class Reference

Static Public Member Functions

static registerFunctions (&$parser)
 
static runCalendarStartDate (&$parser, $calendar_type='month', $calendar_start_day=null, $calendar_days=7, $default_year=null, $default_month=null, $default_day=null)
 
static runCalendarEndDate (&$parser, $calendar_type='month', $calendar_start_day=null, $calendar_days=7, $default_year=null, $default_month=null, $default_day=null)
 
static getBoundaryDates ( $calendar_type='month', $calendar_start_day=null, $calendar_days=7, $default_year=null, $default_month=null, $default_day=null)
 

Detailed Description

Parser functions for the Semantic Result Formats extension.

Two parser functions are defined, both for use by the Calendar format:

#calendarstartdate returns the start date for the set of dates being displayed on the screen, according to the query string.

#calendarenddate returns the day after the end date for the set of dates being displayed on the screen, according to the query string.

Author
David Loomer

Member Function Documentation

◆ getBoundaryDates()

static SRFParserFunctions::getBoundaryDates (   $calendar_type = 'month',
  $calendar_start_day = null,
  $calendar_days = 7,
  $default_year = null,
  $default_month = null,
  $default_day = null 
)
static

Obtain both a lower- and upper- bound date to be used for querying.

Parameters
$calendar_typestring Values: 'month' (the default) for monthly calendar such as SRF Calendar; others not yet defined.
$calendar_start_dayint Optionally force the lower bound date to be a certain day of the week (0 for Sunday, 6 for Saturday). If using a $calendar_type of 'month' this parameter is ignored, as the start day of week for a monthly calendar is currently always set as Sunday. Ohterwise defaults to either the day supplied in the query string, or the current day.
$calendar_daysint The number of days to display. Ignored if using a $calendar_type of 'month'; otherwise defaults to 7.
$default_yearint (Optional) Default year if none is specified in the query string. If parameter is not supplied, will fall back to current year.
$default_monthint (Optional) Default month if none is specified in the query string. If parameter is not supplied, will fall back to current month.
$default_dayint (Optional) Default day of month if none is specified in the query string. If parameter is not supplied, will fall back to current day of month.
Returns
array First element contains the lower bound date, second element contains the upper bound, third element contains a date indicating the year/month/day to be queried.

The documentation for this class was generated from the following file:

About | General disclaimer | Privacy policy