mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
afb06e4a80
commit
eb25344862
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user