You are here

function calendar_systems_get_calendar_instance in Calendar Systems 8

Same name and namespace in other branches
  1. 5 calendar_systems.module \calendar_systems_get_calendar_instance()
  2. 6.3 calendar_systems.module \calendar_systems_get_calendar_instance()
  3. 6 calendar_systems.module \calendar_systems_get_calendar_instance()
  4. 7.3 calendar_systems.module \calendar_systems_get_calendar_instance()
  5. 7 calendar_systems.helpers.inc \calendar_systems_get_calendar_instance()
  6. 7.2 calendar_systems.helpers.inc \calendar_systems_get_calendar_instance()

Gets an instance of the calendar object for the selected calendar system acording to the settings or the passed arguments

Return value

Calendar object or default on fail.

13 calls to calendar_systems_get_calendar_instance()
calendar_systems_date_popup_process_alter in ./calendar_systems.module
Supporing date module's date_popup element hook_date_popup_process_alter
calendar_systems_date_properties_entity_presave in calendar_systems_date_properties/calendar_systems_date_properties.module
hook_entity_presave
calendar_systems_date_select_process_alter in ./calendar_systems.module
Supporing date module's date_select element
calendar_systems_date_text_process_alter in ./calendar_systems.module
Supporing date module's date_text element hook_date_text_process_alter
calendar_systems_format_date_alter in ./calendar_systems.module
Implementation of format_date_alter hook/call Altering out of format_date function

... See full list

File

./calendar_systems.helpers.inc, line 525

Code

function calendar_systems_get_calendar_instance($calendar_system = NULL, $language = NULL) {

  // Load module dependencies:
  _calendar_systems_load_dependencies();
  if (is_null($calendar_system)) {
    $calendar_system = calendar_systems_get_calendar_system_name($language);
  }
  if ($calendar_system == 'default') {
    $calendar_system = 'gregorian';
  }
  $calendar = cmfcCalendar::factory('v1', array(
    'name' => $calendar_system,
  ));
  return $calendar;
}