【发布时间】:2014-03-04 14:16:11
【问题描述】:
我正在为我的表单使用 drupal 7 date_popup 字段类型:
$form['departure_date_1']= array(
'#type' => 'date_popup',
'#date_format' => 'Y-m-d',
'#defalut_value'=>date('Y-m-d',strtotime($date_part1)),
);
$date_part1 是字符串:“2014-03-12”,我使用 strtotime 将其转换为日期。我也试过了:
$form['departure_date_1']= array(
'#type' => 'date_popup',
'#date_format' => 'Y-m-d',
'#defalut_value'=>date('Y-m-d'),
);
或者:
$form['departure_date_1']= array(
'#type' => 'date_popup',
'#date_format' => 'Y-m-d',
'#defalut_value'=>'2014-03-12',
);
它们都不起作用,文件一直是空白的,我搜索了一整天,但仍然找不到问题。
【问题讨论】:
标签: date drupal-7 drupal-forms