feat: 03 => update expiration date handling to accept string format and improve validation
This commit is contained in:
parent
199a008095
commit
095f190f99
3 changed files with 9 additions and 9 deletions
|
|
@ -511,7 +511,7 @@ export async function getAttachmentHead(api: AxiosInstance, url: string) {
|
|||
if (res) return res.headers;
|
||||
}
|
||||
|
||||
export function calculateDaysUntilExpire(expireDate: Date): number {
|
||||
export function calculateDaysUntilExpire(expireDate: Date | string): number {
|
||||
const today = new Date();
|
||||
const expire = new Date(expireDate);
|
||||
const diffInTime = expire.getTime() - today.getTime();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue