Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dashboard upcoming issues list #1904

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions apps/app/components/workspace/issues-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ export const IssuesList: React.FC<Props> = ({ issues, type }) => {
>
<h4 className="capitalize">{type}</h4>
<h4 className="col-span-2">Issue</h4>
<h4>Due Date</h4>
<h4>{type === "overdue" ? "Due" : "Start"} Date</h4>
</div>
<div className="max-h-72 overflow-y-scroll">
{issues.length > 0 ? (
issues.map((issue) => {
const dateDifference = getDateDifference(new Date(issue.target_date as string));
const date = type === "overdue" ? issue.target_date : issue.start_date;

const dateDifference = getDateDifference(new Date(date as string));

return (
<Link
Expand All @@ -75,7 +77,7 @@ export const IssuesList: React.FC<Props> = ({ issues, type }) => {
</h5>
<h5 className="col-span-2">{truncateText(issue.name, 30)}</h5>
<h5 className="cursor-default">
{renderShortDateWithYearFormat(new Date(issue.target_date as string))}
{renderShortDateWithYearFormat(new Date(date?.toString() ?? ""))}
</h5>
</div>
</a>
Expand Down
3 changes: 2 additions & 1 deletion apps/app/types/issues.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ export interface IIssueLite {
id: string;
name: string;
project_id: string;
target_date: string;
start_date?: string | null;
target_date?: string | null;
workspace__slug: string;
}

Expand Down