function date_type_format in Date 8
Same name and namespace in other branches
- 5.2 date_api.module \date_type_format()
- 6.2 date_api.module \date_type_format()
- 6 date_api.module \date_type_format()
- 7.3 date_api/date_api.module \date_type_format()
- 7 date_api/date_api.module \date_type_format()
- 7.2 date_api/date_api.module \date_type_format()
Helper function for getting the format string for a date type.
Parameters
string $type: A date type format name.
Return value
string A date type format, like 'Y-m-d H:i:s'.
9 calls to date_type_format()
- date_combo_validate in ./
date_elements.inc - Validate and update a combo element. Don't try this if there were errors before reaching this point.
- date_default_value in ./
date.module - The callback for setting a default value for an empty date field.
- date_field_field_load in date_field/
date_field.module - Implements hook_field_load().
- date_field_load in ./
date.field.inc - Implements hook_field_load().
- date_field_validate in ./
date.field.inc - Implements hook_field_validate().
File
- date_api/
date_api.module, line 197 - 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_type_format($type) {
switch ($type) {
case DATE_ISO:
return DATE_FORMAT_ISO;
case DATE_UNIX:
return DATE_FORMAT_UNIX;
case DATE_DATETIME:
return DATE_FORMAT_DATETIME;
case DATE_ICAL:
return DATE_FORMAT_ICAL;
}
}