diff options
-rwxr-xr-x | lib/Controller/NoteController.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php index ed4ea0b..dcb8994 100755 --- a/lib/Controller/NoteController.php +++ b/lib/Controller/NoteController.php @@ -269,7 +269,11 @@ } if($saveDB){ usort($myDbContent->data, function($a, $b) { - return $a->time <=> $b->time; + if($a->time <= $b->time) + return -1; + if($a->time >= $b->time) + return 1; + return 0; }); $myDb->putContent(json_encode($myDbContent)); } @@ -316,7 +320,11 @@ } if($saveDB){ usort($myDbContent->data, function($a, $b) { - return $a->time <=> $b->time; + if($a->time <= $b->time) + return -1; + if($a->time >= $b->time) + return 1; + return 0; }); $myDb->putContent(json_encode($myDbContent)); } |