mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
fix bug: validation in server side
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@45708 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
09d9e7bc24
commit
4dafd5b16e
@ -8,7 +8,9 @@ class DMYDateField extends CalendarDateField {
|
|||||||
function setValue( $value ) {
|
function setValue( $value ) {
|
||||||
if( is_array( $value ) && $value['Day'] && $value['Month'] && $value['Year'] )
|
if( is_array( $value ) && $value['Day'] && $value['Month'] && $value['Year'] )
|
||||||
$this->value = $value['Year'] . '-' . $value['Month'] . '-' . $value['Day'];
|
$this->value = $value['Year'] . '-' . $value['Month'] . '-' . $value['Day'];
|
||||||
else
|
else if(is_array($value)&&(!$value['Day']||!$value['Month']||!$value['Year']))
|
||||||
|
$this->value = null;
|
||||||
|
else if(is_string($value))
|
||||||
$this->value = $value;
|
$this->value = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user