function date_node_import_values_alter_date_select in Node import 6
1 call to date_node_import_values_alter_date_select()
- date_node_import_values_alter in supported/date/date.inc
- Implementation of hook_node_import_values_alter().
File
- supported/date/date.inc, line 170
- Support file for the CCK Date module.
Code
function date_node_import_values_alter_date_select(&$values, $fields, $fieldname, $fieldinfo) {
foreach ($fieldinfo['columns'] as $colname => $colinfo) {
if (count($values[$fieldname]) == 0) {
$values[$fieldname] = array();
$values[$fieldname][0] = array();
$values[$fieldname][0][$colname] = array(
'year' => null,
'hour' => 0,
'minute' => 0,
'second' => 0,
'month' => null,
'day' => null,
);
}
else {
$cck_fieldname = node_import_cck_name($fieldname, $colname);
foreach ($values[$fieldname] as $i => $value) {
$values[$fieldname][$i][$colname] = date_convert($value[$colname], $fields[$cck_fieldname]['output_format'], $fields[$cck_fieldname]['date_format']);
$values[$fieldname][$i][$colname]['minute'] = str_pad($values[$fieldname][$i][$colname]['minute'], 2, "0", STR_PAD_LEFT);
$values[$fieldname][$i][$colname]['second'] = str_pad($values[$fieldname][$i][$colname]['second'], 2, "0", STR_PAD_LEFT);
}
}
}
}