Add 'lang' attribute to front-end date field schema

This commit is contained in:
Saophalkun Ponlu 2017-04-06 17:23:52 +12:00 committed by Ingo Schommer
parent 62309df04c
commit 81a21f68cd

View File

@ -290,6 +290,12 @@ class DateField extends TextField
return $attributes; return $attributes;
} }
public function getSchemaDataDefaults()
{
$defaults = parent::getSchemaDataDefaults();
return array_merge($defaults, [ 'lang' => i18n::convert_rfc1766($this->getLocale()) ]);
}
public function Type() public function Type()
{ {
return 'date text'; return 'date text';