Pass html5 flag to front-end

This commit is contained in:
Saophalkun Ponlu 2017-04-12 22:39:23 +12:00 committed by Ingo Schommer
parent 9f8fe88eea
commit 4a70662940
3 changed files with 23 additions and 1 deletions

View File

@ -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()

View File

@ -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;

View File

@ -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';