I could not find a way to get a DateTime-Picker, so I ended up using 2 Fields.
First add the extra field CreatTime in the $db (rebuild!)
and then Create a getCMSFields override function
create, config and add the fields, and it works.
Updated Article.php
<?php
class Article extends DataObject {
private static $db = array(
'Heading' => 'Varchar',
'CreateDate' => 'Date',
'CreateTime' => 'Time',
'Author' => 'Varchar',
'Content' => 'HTMLText'
);
private static $belongs_many_many = array(
'Article' => 'ArticleHolder'
);
public static $summary_fields = array(
'Heading' => 'Heading',
'CreateDate' => 'Date',
'Author' => 'Author'
);
static $default_sort = "CreateDate ASC";
private static $searchable_fields = array(
'Heading' => 'PartialMatchFilter'
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$dateField = new DateField('CreateDate','Date','Creation Date?');
$timeField = new TimeField('CreateTime','Time','now');
$dateField->setConfig('showcalendar', true);
$timeField->setConfig('use_strtotime', true);
$fields->addFieldToTab('Root.Main',$dateField,'Author');
$fields->addFieldToTab('Root.Main',$timeField,'Author');
return $fields;
}
}
Any improvements are always welcome.