Skip to content

Commit

Permalink
bugfix(#71): fix end date of current job
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardRNStudio committed Nov 9, 2024
1 parent 4031ad7 commit 0327069
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/app/(home)/_components/Work/WorkItem/WorkItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<a
href={link}
Expand All @@ -34,7 +31,8 @@ const WorkItem = ({
</div>
<div className="flex justify-end w-4/12 items-center">
<span>
{startDateYear}{isEndDateNow ? <em>Now</em> : endDateYear}
{startDateYear}{' '}
{isEndDateMatchingStartDate ? <em>Now</em> : endDateYear}
</span>
</div>
</div>
Expand Down

0 comments on commit 0327069

Please sign in to comment.