You are here

function date_get_formats in Date 6.2

Same name and namespace in other branches
  1. 5 date.module \date_get_formats()

Get the list of date formats for a particular format length.

Parameters

$type: The format type: 'short', 'medium', 'long', 'custom'. If empty, then all available formats will be returned.

$reset: Whether or not to reset this function's internal cache (defaults to FALSE).

Return value

Array of date formats.

7 calls to date_get_formats()
date_api_configure_custom_date_formats in ./date_api.admin.inc
Allow users to configure custom date formats.
date_api_date_format_form_elements in ./date_api.admin.inc
Add drop down selects for date format types.
date_api_date_time_settings_validate in ./date_api.admin.inc
date_formats_rebuild in ./date_api.module
Resets the database cache of date formats, and saves all new date formats to the database.
date_format_options in date_popup/date_popup.module
Store personalized format options for each user.

... See full list

File

./date_api.module, line 1898
This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.

Code

function date_get_formats($type = NULL, $reset = FALSE) {
  static $_date_formats;
  if ($reset || !isset($_date_formats)) {
    $_date_formats = _date_formats_build();
  }
  return $type ? isset($_date_formats[$type]) ? $_date_formats[$type] : FALSE : $_date_formats;
}