certificate display

This commit is contained in:
yoan
2024-11-21 13:17:39 +08:00
parent 2d10fa0218
commit 09e4b24445
15 changed files with 331 additions and 45 deletions

View File

@@ -31,6 +31,14 @@ export const getLeftDays = (zuluTime: string) => {
return days;
};
export const diffDays = (date1: string, date2: string) => {
const target1 = new Date(date1);
const target2 = new Date(date2);
const diff = target1.getTime() - target2.getTime();
const days = Math.ceil(diff / (1000 * 60 * 60 * 24));
return days;
};
export function getTimeBefore(days: number): string {
// 获取当前时间
const currentDate = new Date();