Skip to content

Commit

Permalink
update the year number to ordinal numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
IcedTea2K committed Dec 5, 2023
1 parent 21a1b09 commit ad19326
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Binary file added src/assets/profile_pictures/Rowel_Sabahat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion src/components/ProfileCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ const handleImgErr = (e: Event) => {
const target = e.target as HTMLImageElement
target.src = emptyPic
}
const turnOrdinal = (year : number) => {
switch(year % 10) {
case 1:
return year + 'st'
case 2:
return year + 'nd'
case 3:
return year + 'rd'
default:
return year + 'th'
}
}
</script>

<template>
Expand Down Expand Up @@ -58,7 +71,7 @@ const handleImgErr = (e: Event) => {
<div class="flex flex-col items-center content-start gap-0 p-[0.5rem] max-h-full">
<div class="text-lg font-bold text-white">{{ member?.name }}</div>
<div class="text-xs font-normal relative bottom-1">
{{ member?.major }} · {{ member?.year }}th
{{ member?.major }} · {{ turnOrdinal(member?.year) }}
</div>
<p class="text-justify px-[1.6rem] overflow-y-scroll invisible-scroller">
{{ member?.description }}
Expand Down

0 comments on commit ad19326

Please sign in to comment.