Fix non-numeric error in sort event function
Fix non-numeric error in sort event function and fix mixed space and tab indent, use spaces
This commit is contained in:
parent
9ce71c26aa
commit
bfe7ad211f
@ -1735,5 +1735,18 @@ function sort_events_by_date($a, $b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If both events have the same start time, longest first
|
// If both events have the same start time, longest first
|
||||||
|
|
||||||
|
if(! is_numeric($b->datef))
|
||||||
|
{
|
||||||
|
// when event B have no end timestamp, event B should sort be before event A (All day events on top)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(! is_numeric($a->datef))
|
||||||
|
{
|
||||||
|
// when event A have no end timestamp , event A should sort be before event B (All day events on top)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return $b->datef - $a->datef;
|
return $b->datef - $a->datef;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user