Hello,
I would like to set DateField default values (01/01/1900) but i can't : it's always the same date : 01/01/1970 !?
I try :
- 01/01/1900
- 1900/01/01
- 01-01-1900
- 1900-01-01
but nothing works :'(
Could you help me ? Thanks.
My code :
class Document extends Page {
static $db = array(
'Begin' => 'Date',
'End' => 'Date',
);
static $defaults = array(
'Begin' => '01/01/1900',
'End' => '01/01/1900',
);
function getCMSFields() {
$fields = parent::getCMSFields();
$BeginField = new DateField('Begin', 'Begin'));
$EndField = new DateField('End', 'End'));
$BeginField->setConfig('dmyfields', true);
$EndField->setConfig('dmyfields', true);
$fields->addFieldToTab('Root.Content.Main',
new FieldGroup(
new LiteralField('Dates', 'Dates'),
new FieldGroup($BeginField, $EndField)
),
'Content'
);
return $fields;
}
}