mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
Use HTML5 date (with min-date case)
This commit is contained in:
parent
df5681371d
commit
097e136525
@ -192,8 +192,7 @@ class BasicFieldsTestPage extends TestPage
|
|||||||
Object::create('SilverStripe\\Forms\\TextField', 'Text'),
|
Object::create('SilverStripe\\Forms\\TextField', 'Text'),
|
||||||
Object::create('SilverStripe\\Forms\\HTMLEditor\\HTMLEditorField', 'HTMLField', 'HTMLField'),
|
Object::create('SilverStripe\\Forms\\HTMLEditor\\HTMLEditorField', 'HTMLField', 'HTMLField'),
|
||||||
Object::create('SilverStripe\\Forms\\EmailField', 'Email'),
|
Object::create('SilverStripe\\Forms\\EmailField', 'Email'),
|
||||||
Object::create('SilverStripe\\Forms\\PasswordField', 'Password'),
|
// Object::create('SilverStripe\\Forms\\ConfirmedPasswordField', 'ConfirmedPassword')
|
||||||
Object::create('SilverStripe\\Forms\\ConfirmedPasswordField', 'ConfirmedPassword')
|
|
||||||
));
|
));
|
||||||
|
|
||||||
$fields->addFieldsToTab('Root.Numeric', array(
|
$fields->addFieldsToTab('Root.Numeric', array(
|
||||||
@ -235,19 +234,20 @@ class BasicFieldsTestPage extends TestPage
|
|||||||
));
|
));
|
||||||
|
|
||||||
// All these date/time fields generally have issues saving directly in the CMS
|
// All these date/time fields generally have issues saving directly in the CMS
|
||||||
|
$minDate = date('Y-m-d', strtotime('-7 days'));
|
||||||
$fields->addFieldsToTab('Root.DateTime', array(
|
$fields->addFieldsToTab('Root.DateTime', array(
|
||||||
Object::create('SilverStripe\\Forms\\DateField', 'CalendarDate', 'DateField with HTML5')
|
Object::create('SilverStripe\\Forms\\DateField', 'CalendarDate', 'DateField with HTML5 (min date: ' . $minDate . ')')
|
||||||
->setHTML5(true),
|
->setMinDate($minDate),
|
||||||
Object::create('SilverStripe\\Forms\\DateField', 'Date', 'DateField'),
|
Object::create('SilverStripe\\Forms\\DateField', 'Date', 'DateField without HTML5')
|
||||||
Object::create('SilverStripe\\Forms\\SeparatedDateField', 'DMYDate', 'DateField with separate fields'),
|
->setHTML5(false),
|
||||||
Object::create('SilverStripe\\Forms\\TimeField', 'Time', 'TimeField'),
|
Object::create('SilverStripe\\Forms\\TimeField', 'Time', 'TimeField without HTML5')
|
||||||
Object::create('SilverStripe\\Forms\\TimeField', 'TimeHTML5', 'TimeField with HTML5')
|
->setHTML5(false),
|
||||||
->setHTML5(true),
|
Object::create('SilverStripe\\Forms\\TimeField', 'TimeHTML5', 'TimeField with HTML5'),
|
||||||
Object::create('SilverStripe\\Forms\\DatetimeField', 'DateTime', 'DateTime'),
|
$dateTime = Object::create('SilverStripe\\Forms\\DatetimeField', 'DateTime', 'DateTime without HTML5'),
|
||||||
$dateTimeShowCalendar = Object::create('SilverStripe\\Forms\\DatetimeField', 'DateTimeWithCalendar', 'DateTime with calendar')
|
$dateTimeShowCalendar = Object::create('SilverStripe\\Forms\\DatetimeField', 'DateTimeWithCalendar', 'DateTime with HTML5')
|
||||||
));
|
));
|
||||||
// $dateTimeShowCalendar->getTimeField()->setConfig('showdropdown', true);
|
$dateTime->getDateField()->setHTML5(true);
|
||||||
$dateTimeShowCalendar->getDateField()->setHTML5(true);
|
$dateTime->getTimeField()->setHTML5(true);
|
||||||
$dateTimeShowCalendar->setRightTitle('Right title');
|
$dateTimeShowCalendar->setRightTitle('Right title');
|
||||||
|
|
||||||
$fields->addFieldsToTab('Root.File', array(
|
$fields->addFieldsToTab('Root.File', array(
|
||||||
|
Loading…
Reference in New Issue
Block a user