mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
Align date minimums with db defaults
Avoid validation errors by default
This commit is contained in:
parent
902151603c
commit
8cb15a45de
@ -114,14 +114,14 @@ class BasicFieldsTestPage extends TestPage
|
||||
$thirdCat = $cats->offsetGet(2);
|
||||
|
||||
return array(
|
||||
'CalendarDate' => "2002-10-23",
|
||||
'CalendarDate' => "2017-01-31",
|
||||
'Checkbox' => 1,
|
||||
// 'CheckboxSet' => null,
|
||||
'ConfirmedPassword' => 'secret',
|
||||
'CreditCard' => '4000400040004111',
|
||||
'Date' => "2002-10-23",
|
||||
'DateTime' => "2002-10-23 23:59",
|
||||
'DateTimeWithCalendar' => "2002-10-23 23:59",
|
||||
'Date' => "2017-01-31",
|
||||
'DateTime' => "2017-01-31 23:59",
|
||||
'DateTimeWithCalendar' => "2017-01-31 23:59",
|
||||
'DropdownID' => $firstCat->ID,
|
||||
'Email' => 'test@test.com',
|
||||
'GroupedDropdownID' => $firstCat->ID,
|
||||
@ -231,13 +231,14 @@ class BasicFieldsTestPage extends TestPage
|
||||
))
|
||||
));
|
||||
|
||||
// All these date/time fields generally have issues saving directly in the CMS
|
||||
$minDate = date('Y-m-d', strtotime('-7 days'));
|
||||
$minDate = '2017-01-01';
|
||||
$minDateTime = '2017-01-01 23:59:00';
|
||||
$fields->addFieldsToTab('Root.DateTime', array(
|
||||
Object::create('SilverStripe\\Forms\\DateField', 'CalendarDate', 'DateField with HTML5 (min date: ' . $minDate . ')')
|
||||
->setMinDate($minDate),
|
||||
Object::create('SilverStripe\\Forms\\DateField', 'Date', 'DateField without HTML5')
|
||||
->setHTML5(false),
|
||||
Object::create('SilverStripe\\Forms\\DateField', 'Date', 'DateField without HTML5 (min date: ' . $minDate . ')')
|
||||
->setHTML5(false)
|
||||
->setMinDate($minDate),
|
||||
Object::create('SilverStripe\\Forms\\TimeField', 'Time', 'TimeField without HTML5')
|
||||
->setHTML5(false),
|
||||
Object::create('SilverStripe\\Forms\\TimeField', 'TimeHTML5', 'TimeField with HTML5'),
|
||||
|
Loading…
Reference in New Issue
Block a user