From 03270697861662405c39f819ba983d180d908d4b Mon Sep 17 00:00:00 2001 From: RichardRNStudio Date: Sat, 9 Nov 2024 17:20:54 +0100 Subject: [PATCH] bugfix(#71): fix end date of current job --- src/app/(home)/_components/Work/WorkItem/WorkItem.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/(home)/_components/Work/WorkItem/WorkItem.tsx b/src/app/(home)/_components/Work/WorkItem/WorkItem.tsx index ce78a55..95c522a 100644 --- a/src/app/(home)/_components/Work/WorkItem/WorkItem.tsx +++ b/src/app/(home)/_components/Work/WorkItem/WorkItem.tsx @@ -9,10 +9,7 @@ const WorkItem = ({ }: Job) => { const startDateYear = startDate.getFullYear(); const endDateYear = endDate.getFullYear(); - const endDateMonth = endDate.getMonth(); - const isEndDateNow = - endDateYear === new Date().getFullYear() && - endDateMonth === new Date().getMonth(); + const isEndDateMatchingStartDate = startDateYear === endDateYear; return (
- {startDateYear} – {isEndDateNow ? Now : endDateYear} + {startDateYear} –{' '} + {isEndDateMatchingStartDate ? Now : endDateYear}