You are here

function commons_events_update_7004 in Drupal Commons 7.3

Create the event_datetime date format.

File

modules/commons/commons_events/commons_events.install, line 123

Code

function commons_events_update_7004() {
  db_insert('date_formats')
    ->fields(array(
    'format' => 'M d Y - g:ia T',
    'type' => 'event_datetime',
    'locked' => 1,
  ))
    ->execute();
  db_insert('date_format_type')
    ->fields(array(
    'type' => 'event_datetime',
    'title' => 'Event Datetime',
    'locked' => 0,
  ))
    ->execute();
  variable_set('date_format_event_datetime', 'M d Y - g:ia T');

  // Revert commons_events to make sure its referencing the event_datetime module.
  $revert = array(
    'commons_events' => array(
      'field_instance',
    ),
    'commons_events' => array(
      'views_view',
    ),
  );
  features_revert($revert);
  return array();
}