mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-06-29 07:59:31 +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()
|
public function getSchemaDataDefaults()
|
||||||
{
|
{
|
||||||
$defaults = parent::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()
|
public function Type()
|
||||||
|
|
|
@ -103,6 +103,14 @@ class DatetimeField extends TextField
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSchemaDataDefaults()
|
||||||
|
{
|
||||||
|
$defaults = parent::getSchemaDataDefaults();
|
||||||
|
return array_merge($defaults, [
|
||||||
|
'html5' => $this->getHTML5()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
public function Type()
|
public function Type()
|
||||||
{
|
{
|
||||||
return 'text datetime';
|
return 'text datetime';
|
||||||
|
@ -256,6 +264,9 @@ class DatetimeField extends TextField
|
||||||
*/
|
*/
|
||||||
public function setValue($value, $data = null)
|
public function setValue($value, $data = null)
|
||||||
{
|
{
|
||||||
|
// Save raw value for later validation
|
||||||
|
$this->rawValue = $value;
|
||||||
|
|
||||||
// Empty value
|
// Empty value
|
||||||
if (empty($value)) {
|
if (empty($value)) {
|
||||||
$this->value = null;
|
$this->value = null;
|
||||||
|
|
|
@ -231,6 +231,14 @@ class TimeField extends TextField
|
||||||
return $attributes;
|
return $attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSchemaDataDefaults()
|
||||||
|
{
|
||||||
|
$defaults = parent::getSchemaDataDefaults();
|
||||||
|
return array_merge($defaults, [
|
||||||
|
'html5' => $this->getHTML5()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
public function Type()
|
public function Type()
|
||||||
{
|
{
|
||||||
return 'time text';
|
return 'time text';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user