Fix null value in timestamp format.
This commit is contained in:
parent
2883fa0bd0
commit
df0dbaad5c
|
@ -77,7 +77,7 @@ class Format
|
|||
|
||||
public static function duration($duration)
|
||||
{
|
||||
if (! $duration) {
|
||||
if ($duration === null || $duration === false) {
|
||||
return '-';
|
||||
}
|
||||
return self::showHourMin($duration);
|
||||
|
@ -98,7 +98,7 @@ class Format
|
|||
|
||||
public static function timeSince($timestamp)
|
||||
{
|
||||
if (! $timestamp) {
|
||||
if ($timestamp === null || $timestamp === false) {
|
||||
return '-';
|
||||
}
|
||||
if (! preg_match('~^\d+$~', $timestamp)) {
|
||||
|
|
Loading…
Reference in New Issue