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:
parent
1d5a3a02c1
commit
10ab081a0b
12 changed files with 63 additions and 66 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue