mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Pass html5 flag to front-end
This commit is contained in:
parent
9f8fe88eea
commit
4a70662940
@ -293,7 +293,10 @@ class DateField extends TextField
|
||||
public function getSchemaDataDefaults()
|
||||
{
|
||||
$defaults = parent::getSchemaDataDefaults();
|
||||
return array_merge($defaults, [ 'lang' => i18n::convert_rfc1766($this->getLocale()) ]);
|
||||
return array_merge($defaults, [
|
||||
'lang' => i18n::convert_rfc1766($this->getLocale()),
|
||||
'html5' => $this->getHTML5()
|
||||
]);
|
||||
}
|
||||
|
||||
public function Type()
|
||||
|
@ -103,6 +103,14 @@ class DatetimeField extends TextField
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSchemaDataDefaults()
|
||||
{
|
||||
$defaults = parent::getSchemaDataDefaults();
|
||||
return array_merge($defaults, [
|
||||
'html5' => $this->getHTML5()
|
||||
]);
|
||||
}
|
||||
|
||||
public function Type()
|
||||
{
|
||||
return 'text datetime';
|
||||
@ -256,6 +264,9 @@ class DatetimeField extends TextField
|
||||
*/
|
||||
public function setValue($value, $data = null)
|
||||
{
|
||||
// Save raw value for later validation
|
||||
$this->rawValue = $value;
|
||||
|
||||
// Empty value
|
||||
if (empty($value)) {
|
||||
$this->value = null;
|
||||
|
@ -231,6 +231,14 @@ class TimeField extends TextField
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
public function getSchemaDataDefaults()
|
||||
{
|
||||
$defaults = parent::getSchemaDataDefaults();
|
||||
return array_merge($defaults, [
|
||||
'html5' => $this->getHTML5()
|
||||
]);
|
||||
}
|
||||
|
||||
public function Type()
|
||||
{
|
||||
return 'time text';
|
||||
|
Loading…
Reference in New Issue
Block a user