2025-02-11 12:34:39 +00:00
|
|
|
export function getLotteryStatus(startTime: string, endTime: string) {
|
2025-02-08 09:02:21 +00:00
|
|
|
const now = new Date();
|
|
|
|
|
const start = new Date(startTime);
|
|
|
|
|
const end = new Date(endTime);
|
|
|
|
|
|
|
|
|
|
if (now < start) {
|
|
|
|
|
return "Upcoming";
|
|
|
|
|
} else if (now >= start && now <= end) {
|
|
|
|
|
return "Ongoing";
|
|
|
|
|
} else {
|
|
|
|
|
return "Finished";
|
|
|
|
|
}
|
|
|
|
|
}
|