Hi There,
I am having sone dificulty getting my hook_update to recognise and update my 'date'.
I can do update with other fields ok.
$day= format_date($node->work->date_of_work,'custom','j');
$month= format_date($node->work->date_of_work,'custom','n');
$year= format_date($node->work->date_of_work,'custom','Y');
$form['date_of_work'] = array(
'#type' => 'date',
'#title' => t('Date of Work'),
//'#default_value' => array('year' => 1997, 'month' => 1, 'day' => 1),
'#default_value' => array('day' => isset($node->work->date_of_work) ? $day : 1,
'month' => isset($node->work->data_of_work) ? $month : 12,
'year' => isset($node->work->date_of_work) ? $year : 1989
),
'#description' => t("Date of the work if known"),
);
If I substitute $node->date_of_work['year'] for a integer it works fine.
How do I get the value out of this array, please?
function catres_update($node) {
db_query("UPDATE {cr_work} SET
title = '%s',
date_of_work = '%d',
WHERE nid = '%d' ",
$node->title,
HOW to get this value ???
mktime(0,0,0,11,11,$node->date_of_work['year']),