chore: cycle current status (#3270)

* dev: cycle status

* chore: cycle status logic updated

---------

Co-authored-by: Anmol Singh Bhatia <anmolsinghbhatia@plane.so>
This commit is contained in:
Bavisetti Narayan 2023-12-29 15:24:07 +05:30 committed by GitHub
parent 1d5a3a02c1
commit 10ab081a0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 63 additions and 66 deletions

View file

@ -170,18 +170,6 @@ export const formatLongDateDistance = (date: string | Date) => {
}
};
export const getDateRangeStatus = (startDate: string | null | undefined, endDate: string | null | undefined) => {
if (!startDate || !endDate) return "draft";
const now = new Date();
const start = new Date(startDate);
const end = new Date(endDate);
if (start <= now && end >= now) return "current";
else if (start > now) return "upcoming";
else return "completed";
};
export const renderShortDateWithYearFormat = (date: string | Date, placeholder?: string) => {
if (!date || date === "") return null;