function feeds_xls_feeds_set_target_date in Feeds XLS 7
Callback for setting date fields
1 string reference to 'feeds_xls_feeds_set_target_date'
File
- ./
feeds_xls.module, line 190
Code
function feeds_xls_feeds_set_target_date($source, $entity, $target, $value) {
if (strpos(get_class($source->importer->parser), 'FeedsExcelParser') !== FALSE && is_numeric($value)) {
$userDate = PHPExcel_Shared_Date::ExcelToPHPObject($value);
$date = new DateTime($userDate
->format('Y-m-d H:i:s'), new DateTimeZone(drupal_get_user_timezone()));
$date
->setTimezone(new DateTimeZone('UTC'));
$value = $date
->format('Y-m-d H:i:s');
}
return date_feeds_set_target($source, $entity, $target, $value);
}