function date_field_load in Date 7
Same name and namespace in other branches
- 8 date.field.inc \date_field_load()
- 7.3 date.field.inc \date_field_load()
- 7.2 date.field.inc \date_field_load()
Implements hook_field_load().
File
- ./
date.field.inc, line 283 - Field hooks to implement a date field.
Code
function date_field_load($entity_type, $entities, $field, $instances, $langcode, &$items, $age) {
foreach ($entities as $id => $entity) {
foreach ($items[$id] as $delta => $item) {
// If the file does not exist, mark the entire item as empty.
$timezone = isset($item['timezone']) ? $item['timezone'] : '';
if (is_array($item)) {
$items[$id][$delta]['timezone'] = date_get_timezone($field['settings']['tz_handling'], $timezone);
$items[$id][$delta]['timezone_db'] = date_get_timezone_db($field['settings']['tz_handling']);
$items[$id][$delta]['date_type'] = $field['type'];
}
}
}
}