function theme_sheetnode_formatter_socialcalc_date in Sheetnode 6
Same name and namespace in other branches
- 5 sheetnode.module \theme_sheetnode_formatter_socialcalc_date()
Theme function for SocialCalc date formatter.
File
- ./
sheetnode.module, line 857
Code
function theme_sheetnode_formatter_socialcalc_date($element) {
require_once drupal_get_path('module', 'sheetnode') . '/socialcalc.inc';
$field_name = $element['#field_name'];
$fields = content_fields();
$field = $fields[$field_name];
$item = $element['#item'];
$value = $item['value'];
if ($field['type'] == DATE_ISO) {
$value = str_replace(' ', 'T', date_fuzzy_datetime($value));
}
$date = date_make_date($value, NULL, $field['type'], $field['granularity']);
return socialcalc_import_date($date);
}