Skip to content

Commit

Permalink
some changes; maybe fixed now
Browse files Browse the repository at this point in the history
version-patch
  • Loading branch information
trueberryless committed Jul 11, 2024
1 parent cb9bfbb commit 5329649
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/components/dashboard/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ export default function Dashboard() {
project.tasks
.map((task: any) => ({ ...task, mostRecentDate: getMostRecentSessionDate(task) }))
.sort(
(task1: { mostRecentDate: number }, task2: { mostRecentDate: number }) =>
task2.mostRecentDate - task1.mostRecentDate
(task1: { mostRecentDate: Date }, task2: { mostRecentDate: Date }) =>
new Date(task2.mostRecentDate).valueOf() -
new Date(task1.mostRecentDate).valueOf()
)
)
.slice(0, 5);
Expand Down
2 changes: 1 addition & 1 deletion src/components/projects/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import Link from "next/link";
import { Plus } from "lucide-react";

interface TEntity {
id: number;
id: string;
}

interface DataTableProps<TData extends TEntity, TValue> {
Expand Down
2 changes: 1 addition & 1 deletion src/components/sessions/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import Link from "next/link";
import { Plus } from "lucide-react";

interface TEntity {
id: number;
id: string;
}

interface DataTableProps<TData extends TEntity, TValue> {
Expand Down
2 changes: 1 addition & 1 deletion src/components/tasks/data-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { Plus } from "lucide-react";
import { useUser } from "../UserContext";

interface TEntity {
id: number;
id: string;
}

interface DataTableProps<TData extends TEntity, TValue> {
Expand Down
5 changes: 4 additions & 1 deletion src/pages/projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ export default function Projects() {
isArchived: project.archivedAt ? true : false,
mostRecentDate: getMostRecentSessionDate(project),
}))
.sort((project1, project2) => project2.mostRecentDate - project1.mostRecentDate)
.sort(
(project1, project2) =>
project2.mostRecentDate.valueOf() - project1.mostRecentDate.valueOf()
)
.slice(0, 5);

return (
Expand Down

0 comments on commit 5329649

Please sign in to comment.