diff --git a/web/store/cycle.store.ts b/web/store/cycle.store.ts index 16ada6060a7..a970eee8222 100644 --- a/web/store/cycle.store.ts +++ b/web/store/cycle.store.ts @@ -1,6 +1,6 @@ import { action, computed, observable, makeObservable, runInAction } from "mobx"; import { computedFn } from "mobx-utils"; -import { isFuture, isPast } from "date-fns"; +import { isFuture, isPast, isToday } from "date-fns"; import set from "lodash/set"; import sortBy from "lodash/sortBy"; // types @@ -118,7 +118,8 @@ export class CycleStore implements ICycleStore { if (!projectId || !this.fetchedMap[projectId]) return null; let completedCycles = Object.values(this.cycleMap ?? {}).filter((c) => { const hasEndDatePassed = isPast(new Date(c.end_date ?? "")); - return c.project_id === projectId && hasEndDatePassed; + const isEndDateToday = isToday(new Date(c.end_date ?? "")); + return c.project_id === projectId && hasEndDatePassed && !isEndDateToday; }); completedCycles = sortBy(completedCycles, [(c) => c.sort_order]); const completedCycleIds = completedCycles.map((c) => c.id);