You are here

function partial_date_component_format_options in Partial Date 7

1 call to partial_date_component_format_options()
partial_date_type_format_elements in ./partial_date.pages.inc

File

./partial_date.pages.inc, line 278
Page and form callbacks for handling the date format.

Code

function partial_date_component_format_options($component, array $additional_values = array()) {
  static $options = NULL;
  if (!isset($options)) {
    $options = array(
      'year' => array(
        'Y' => t('A full numeric representation of a year. Eg: -125, 2003', array(), array(
          'context' => 'datetime',
        )),
        'y' => t('A two digit representation of a year. Eg: -25, 03', array(), array(
          'context' => 'datetime',
        )),
        'Y-ce' => t('A full numeric representation of a year with year designation. Eg: 125BC, 125BCE or -125', array(), array(
          'context' => 'datetime',
        )),
        'y-ce' => t('A two digit representation of a year with year designation. Eg: 25BC, 25BCE or -25', array(), array(
          'context' => 'datetime',
        )),
      ),
      'month' => array(
        'F' => t('A full textual representation of a month, January through December.', array(), array(
          'context' => 'datetime',
        )),
        'm' => t('Numeric representation of a month, with leading zeros, 01 through 12', array(), array(
          'context' => 'datetime',
        )),
        'M' => t('A short textual representation of a month, three letters, Jan through Dec.', array(), array(
          'context' => 'datetime',
        )),
        'n' => t('Numeric representation of a month, without leading zeros, 1 through 12', array(), array(
          'context' => 'datetime',
        )),
      ),
      'day' => array(
        'd' => t('Day of the month, 2 digits with leading zeros, 01 through 31', array(), array(
          'context' => 'datetime',
        )),
        'j' => t('Day of the month without leading zeros, 1 through 31.', array(), array(
          'context' => 'datetime',
        )),
        'd-S' => t('Day of the month, 2 digits with leading zeros with English ordinal suffix.', array(), array(
          'context' => 'datetime',
        )),
        'j-S' => t('Day of the month without leading zeros with English ordinal suffix.', array(), array(
          'context' => 'datetime',
        )),
        // 'z' => t('The day of the year (starting from 0).', array(), array('context' => 'datetime')),
        'l' => t('A full textual representation of the day of the week.', array(), array(
          'context' => 'datetime',
        )),
        'D' => t('A textual representation of a day, three letters.', array(), array(
          'context' => 'datetime',
        )),
        // 'N' => t('ISO-8601 numeric representation of the day of the week.', array(), array('context' => 'datetime')),
        // 'S' => t('English ordinal suffix for the day of the month.', array(), array('context' => 'datetime')),
        'w' => t('Numeric representation of the day of the week  0 (for Sunday) through 6 (for Saturday).', array(), array(
          'context' => 'datetime',
        )),
      ),
      'hour' => array(
        'g' => t('12-hour format of an hour without leading zeros, 1 through 12.', array(), array(
          'context' => 'datetime',
        )),
        'G' => t('24-hour format of an hour without leading zeros, 0 through 23.', array(), array(
          'context' => 'datetime',
        )),
        'h' => t('12-hour format of an hour with leading zeros, 01 through 12.', array(), array(
          'context' => 'datetime',
        )),
        'H' => t('24-hour format of an hour with leading zeros, 00 through 23.', array(), array(
          'context' => 'datetime',
        )),
      ),
      'minute' => array(
        'i' => t('Minutes with leading zeros, 00 through 59.', array(), array(
          'context' => 'datetime',
        )),
      ),
      'second' => array(
        's' => t('Seconds, with leading zeros, 00 through 59.', array(), array(
          'context' => 'datetime',
        )),
      ),
      'timezone' => array(
        'e' => t('Timezone identifier. Eg: UTC, GMT, Atlantic/Azores.', array(), array(
          'context' => 'datetime',
        )),
        'T' => t('Timezone abbreviation. Eg: EST, MDT', array(), array(
          'context' => 'datetime',
        )),
      ),
    );
  }
  return $additional_values + $options[$component];
}