mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
Merge pull request #32 from open-sausages/pulls/4.0/6626-remove-jquery-datepicker
HTML5 date
This commit is contained in:
commit
b3301548ea
@ -55,6 +55,7 @@ class BasicFieldsTestPage extends TestPage
|
|||||||
'Text' => 'Varchar',
|
'Text' => 'Varchar',
|
||||||
'Textarea' => 'Text',
|
'Textarea' => 'Text',
|
||||||
'Time' => 'Time',
|
'Time' => 'Time',
|
||||||
|
'TimeHTML5' => 'Time',
|
||||||
'ToggleCompositeTextField1' => 'Varchar',
|
'ToggleCompositeTextField1' => 'Varchar',
|
||||||
'ToggleCompositeDropdownField' => 'Varchar',
|
'ToggleCompositeDropdownField' => 'Varchar',
|
||||||
'Validated' => 'Text',
|
'Validated' => 'Text',
|
||||||
@ -152,6 +153,7 @@ class BasicFieldsTestPage extends TestPage
|
|||||||
'Text' => 'My value (ä!)',
|
'Text' => 'My value (ä!)',
|
||||||
'Textarea' => 'My value (ä!)',
|
'Textarea' => 'My value (ä!)',
|
||||||
'Time' => "23:59",
|
'Time' => "23:59",
|
||||||
|
'TimeHTML5' => "23:59",
|
||||||
'ToggleCompositeTextField1' => 'My value (ä!)',
|
'ToggleCompositeTextField1' => 'My value (ä!)',
|
||||||
'Validated' => '1',
|
'Validated' => '1',
|
||||||
);
|
);
|
||||||
@ -190,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(
|
||||||
@ -233,17 +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(
|
||||||
$calendarDateField = Object::create('SilverStripe\\Forms\\DateField', 'CalendarDate', 'DateField with calendar'),
|
Object::create('SilverStripe\\Forms\\DateField', 'CalendarDate', 'DateField with HTML5 (min date: ' . $minDate . ')')
|
||||||
Object::create('SilverStripe\\Forms\\DateField', 'Date', 'DateField'),
|
->setMinDate($minDate),
|
||||||
$dmyDateField = Object::create('SilverStripe\\Forms\\SeparatedDateField', 'DMYDate', 'DateField with separate fields'),
|
Object::create('SilverStripe\\Forms\\DateField', 'Date', 'DateField without HTML5')
|
||||||
Object::create('SilverStripe\\Forms\\TimeField', 'Time', 'TimeField'),
|
->setHTML5(false),
|
||||||
Object::create('SilverStripe\\Forms\\DatetimeField', 'DateTime', 'DateTime'),
|
Object::create('SilverStripe\\Forms\\TimeField', 'Time', 'TimeField without HTML5')
|
||||||
$dateTimeShowCalendar = Object::create('SilverStripe\\Forms\\DatetimeField', 'DateTimeWithCalendar', 'DateTime with calendar')
|
->setHTML5(false),
|
||||||
|
Object::create('SilverStripe\\Forms\\TimeField', 'TimeHTML5', 'TimeField with HTML5'),
|
||||||
|
$dateTime = Object::create('SilverStripe\\Forms\\DatetimeField', 'DateTime', 'DateTime without HTML5'),
|
||||||
|
$dateTimeShowCalendar = Object::create('SilverStripe\\Forms\\DatetimeField', 'DateTimeWithCalendar', 'DateTime with HTML5')
|
||||||
));
|
));
|
||||||
$calendarDateField->setShowCalendar(true);
|
$dateTime->getDateField()->setHTML5(true);
|
||||||
$dateTimeShowCalendar->getDateField()->setShowCalendar(true);
|
$dateTime->getTimeField()->setHTML5(true);
|
||||||
// $dateTimeShowCalendar->getTimeField()->setConfig('showdropdown', 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