mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Bad time formatting returns now null
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44168 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
4c76be62c9
commit
0ea568672e
@ -25,8 +25,11 @@ class TimeField extends TextField {
|
||||
* Change the setValue to store the time (in a datetime field)
|
||||
* we store the current date as well (although we don't use it for this field)
|
||||
*/
|
||||
function setValue($val) {
|
||||
$this->value = (date("Y-m-d",time()) . " " . date("H:i",strtotime($val)) );
|
||||
function setValue( $val ) {
|
||||
if( $val )
|
||||
$this->value = (date("Y-m-d",time()) . " " . date("H:i",strtotime($val)) );
|
||||
else
|
||||
$this->value = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user