You are here

function _sf_node_export_cck_date in Salesforce Suite 6.2

1 string reference to '_sf_node_export_cck_date'
_sf_contrib_add_fields in sf_contrib/sf_contrib.module

File

sf_contrib/sf_contrib.module, line 172
Provides integration with Location and CCK.

Code

function _sf_node_export_cck_date($node, $drupal_fieldname, $drupal_field_definition, $sf_field_definition) {
  list($fieldname, $column) = explode(':', $drupal_fieldname, 2);
  if (empty($column)) {
    $column = 'value';
  }
  switch ($node->{$fieldname}[0]['date_type']) {
    case 'datestamp':
      $from_type = DATE_UNIX;
      break;
    case 'datetime':
      $from_type = DATE_DATETIME;
      break;
    case 'date':
      $from_type = DATE_ISO;
      break;
  }
  $date = date_convert($node->{$fieldname}[0][$column], $from_type, DATE_UNIX);
  return gmdate(DATE_ATOM, $date);
}