You are here

function theme_sheetnode_formatter_socialcalc_date in Sheetnode 5

Same name and namespace in other branches
  1. 6 sheetnode.module \theme_sheetnode_formatter_socialcalc_date()

File

./sheetnode.module, line 572

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);
}