Skip to content

Commit

Permalink
Merge pull request #72 from RichardRNStudio/bugfix/71
Browse files Browse the repository at this point in the history
bugfix(#71): fix end date of current job
  • Loading branch information
RichardRNStudio authored Nov 9, 2024
2 parents 856936a + 0327069 commit 01af23d
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 01af23d

Please sign in to comment.