Files
website/components/resume/DateTag.vue
Arthur DANJOU c698bfec8a lint code
Signed-off-by: Arthur DANJOU <arthurdanjou@outlook.fr>
2024-04-20 00:18:43 +02:00

32 lines
574 B
Vue

<script setup lang="ts">
defineProps({
startDate: String,
endDate: {
type: String,
required: true,
},
})
function formatTodayDate(date: string) {
const split = date.split(' ')
return date === 'Today' ? 'Today' : `${split[0]} ${split[1]}`
}
</script>
<template>
<UBadge
v-if="startDate !== endDate"
size="xs"
variant="soft"
>
{{ formatTodayDate(startDate!.toString()) }} {{ formatTodayDate(endDate) }}
</UBadge>
<UBadge
v-else
size="xs"
variant="soft"
>
{{ formatTodayDate(endDate) }}
</UBadge>
</template>