correct asc/desc
This commit is contained in:
@@ -55,13 +55,13 @@ const Renderer: React.FC = () => {
|
||||
useEffect(() => {
|
||||
const eventSort = (a, b) => {
|
||||
let result = 0;
|
||||
if (order === "ascending") {
|
||||
if (order === "descending") {
|
||||
if (["start_time", "end_time"].includes(sort)) {
|
||||
result = new Date(b[sort]).getTime() - new Date(a[sort]).getTime();
|
||||
} else if (sort === "id") {
|
||||
result = b[sort] - a[sort];
|
||||
}
|
||||
} else if (order === "descending") {
|
||||
} else if (order === "ascending") {
|
||||
if (["start_time", "end_time"].includes(sort)) {
|
||||
result = new Date(a[sort]).getTime() - new Date(b[sort]).getTime();
|
||||
} else if (sort === "id") {
|
||||
|
||||
Reference in New Issue
Block a user