feat: 03 => update expiration date handling to accept string format and improve validation

This commit is contained in:
puriphatt 2025-01-21 16:29:19 +07:00
parent 199a008095
commit 095f190f99
3 changed files with 9 additions and 9 deletions

View file

@ -2,7 +2,7 @@
import { calculateDaysUntilExpire } from 'stores/utils';
defineProps<{
expirationDate: Date;
expirationDate?: Date | string;
showAllDay?: boolean;
}>();
</script>
@ -10,7 +10,7 @@ defineProps<{
<template>
<template
v-if="
calculateDaysUntilExpire(expirationDate) <= 90 ||
(expirationDate && calculateDaysUntilExpire(expirationDate) <= 90) ||
(expirationDate !== undefined && !!showAllDay)
"
>