Skip to content

Commit

Permalink
refactor: ♻️ update yr, yrs, mo, mos
Browse files Browse the repository at this point in the history
  • Loading branch information
spences10 committed Aug 20, 2023
1 parent 08a74b2 commit bedceb1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/components/role-details.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@
end: new Date(intervalEndDate),
})
const yearsAndMonths = () => {
const intervalYears = years ? `${years}yrs` : ''
const intervalMonths = months ? `${months + 1}mos` : '' // Months is zero based!
const intervalYears = years
? `${years}${years === 1 ? 'yr' : 'yrs'}`
: ''
const intervalMonths = months
? `${months}${months === 1 ? 'mo' : 'mos'}`
: ''
if (intervalYears === '' && intervalMonths !== '') {
return `(${intervalMonths})`
}
Expand All @@ -37,6 +42,7 @@
}
return ``
}
return `${formattedStart} - ${formattedEndDate()} ${yearsAndMonths()}`
}
</script>
Expand Down

1 comment on commit bedceb1

@vercel
Copy link

@vercel vercel bot commented on bedceb1 Aug 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

cv – ./

cv-spences10.vercel.app
cv-git-main-spences10.vercel.app
www.mecv.xyz
mecv.xyz

Please sign in to comment.