BUGFIX #4566 Time::Nice() and Time::Nice24() return bad results if there is no value (from r94353)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@95600 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-12-16 05:39:23 +00:00
parent afb06e4a80
commit eb25344862

View File

@ -25,7 +25,7 @@ class Time extends DBField {
* @return string Time in 12 hour format
*/
function Nice() {
return date('g:ia', strtotime($this->value));
if($this->value) return date('g:ia', strtotime($this->value));
}
/**
@ -35,7 +35,7 @@ class Time extends DBField {
* @return string Time in 24 hour format
*/
function Nice24() {
return date('H:i', strtotime($this->value));
if($this->value) return date('H:i', strtotime($this->value));
}
/**