You are here

function availability_calendar_date_formats in Availability Calendars 7.3

Same name and namespace in other branches
  1. 7.5 availability_calendar.module \availability_calendar_date_formats()
  2. 7.4 availability_calendar.module \availability_calendar_date_formats()

Implements hook_date_formats(). @link http://api.drupal.org/api/drupal/modules%21system%21system.api.php/funct...

File

./availability_calendar.module, line 182
Availability Calendar module. Defines an availability calendar as a field.

Code

function availability_calendar_date_formats() {
  $formats = array();

  // Some defaults for date display (booking formlet).
  // @todo: locale suggestions are welcome.
  $formats[] = array(
    'type' => 'availability_calendar_date_display',
    'format' => 'l j F Y',
    'locales' => array(),
  );
  $formats[] = array(
    'type' => 'availability_calendar_date_display',
    'format' => 'l F j, Y',
    'locales' => array(
      'en-us',
    ),
  );

  // Some defaults for user entry in date fields (Views).
  // Locales mostly copied from the short format in includes/date.inc.
  $formats[] = array(
    'type' => 'availability_calendar_date_entry',
    'format' => 'Y-n-j',
    'locales' => array(),
  );
  $formats[] = array(
    'type' => 'availability_calendar_date_entry',
    'format' => 'Y/n/j',
    'locales' => array(
      'en-ca',
      'fr-ca',
      'no-no',
      'sv-se',
    ),
  );
  $formats[] = array(
    'type' => 'availability_calendar_date_entry',
    'format' => 'j-n-Y',
    'locales' => array(
      'nl-nl',
    ),
  );
  $formats[] = array(
    'type' => 'availability_calendar_date_entry',
    'format' => 'j/n/Y',
    'locales' => array(
      'en-gb',
      'en-hk',
      'en-ie',
      'el-gr',
      'es-es',
      'fr-be',
      'fr-fr',
      'fr-lu',
      'it-it',
      'nl-be',
      'pt-pt',
    ),
  );
  $formats[] = array(
    'type' => 'availability_calendar_date_entry',
    'format' => 'j.n.Y',
    'locales' => array(
      'de-ch',
      'de-de',
      'de-lu',
      'fi-fi',
      'fr-ch',
      'is-is',
      'pl-pl',
      'ro-ro',
      'ru-ru',
    ),
  );
  $formats[] = array(
    'type' => 'availability_calendar_date_entry',
    'format' => 'n/j/Y',
    'locales' => array(
      'en-us',
    ),
  );

  // A default for the month caption when theming a calendar month.
  $formats[] = array(
    'type' => 'availability_calendar_month_caption',
    'format' => 'F Y',
    'locales' => array(),
  );
  return $formats;
}