Etemplate - fix using date widget min/max attributes made it required, even if not set as such

This commit is contained in:
nathangray 2019-02-26 13:49:50 -07:00
parent af88cc0822
commit f71b9ba093

View File

@ -179,7 +179,7 @@ class Date extends Transformer
$valid = (string)$value === '' ? '' : (int)$value; $valid = (string)$value === '' ? '' : (int)$value;
} }
if (!empty($this->attrs['min'])) if (!empty($this->attrs['min']) && !empty($value))
{ {
if(is_numeric($this->attrs['min'])) if(is_numeric($this->attrs['min']))
{ {
@ -203,7 +203,7 @@ class Date extends Transformer
$value = $min; $value = $min;
} }
} }
if (!empty($this->attrs['max'])) if (!empty($this->attrs['max']) && !empty($value))
{ {
if(is_numeric($this->attrs['max'])) if(is_numeric($this->attrs['max']))
{ {