fix: dashboard upcoming issues list (#1904)

This commit is contained in:
Aaryan Khandelwal 2023-08-18 17:10:12 +05:30 committed by GitHub
parent 125e9090ea
commit 1f8117c987
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -45,12 +45,14 @@ export const IssuesList: React.FC<Props> = ({ issues, type }) => {
> >
<h4 className="capitalize">{type}</h4> <h4 className="capitalize">{type}</h4>
<h4 className="col-span-2">Issue</h4> <h4 className="col-span-2">Issue</h4>
<h4>Due Date</h4> <h4>{type === "overdue" ? "Due" : "Start"} Date</h4>
</div> </div>
<div className="max-h-72 overflow-y-scroll"> <div className="max-h-72 overflow-y-scroll">
{issues.length > 0 ? ( {issues.length > 0 ? (
issues.map((issue) => { 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 ( return (
<Link <Link
@ -75,7 +77,7 @@ export const IssuesList: React.FC<Props> = ({ issues, type }) => {
</h5> </h5>
<h5 className="col-span-2">{truncateText(issue.name, 30)}</h5> <h5 className="col-span-2">{truncateText(issue.name, 30)}</h5>
<h5 className="cursor-default"> <h5 className="cursor-default">
{renderShortDateWithYearFormat(new Date(issue.target_date as string))} {renderShortDateWithYearFormat(new Date(date?.toString() ?? ""))}
</h5> </h5>
</div> </div>
</a> </a>

View File

@ -207,7 +207,8 @@ export interface IIssueLite {
id: string; id: string;
name: string; name: string;
project_id: string; project_id: string;
target_date: string; start_date?: string | null;
target_date?: string | null;
workspace__slug: string; workspace__slug: string;
} }