Files
twenty/packages/twenty-front/src/modules/activities/calendar/utils/getCalendarEventEndDate.ts
T
Thaïs ab4ab1dfba feat: add next event indicator to Show Page Calendar tab (#4348)
* feat: add next event indicator to Show Page Calendar tab

Closes #4289

* feat: improve calendar animation

* refactor: add some utils and fix sorting edge case with full day

* refactor: rename CalendarCurrentEventIndicator to CalendarCurrentEventCursor

* fix: fix tests

* Fix lint

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-03-12 14:27:51 +01:00

8 lines
293 B
TypeScript

import { endOfDay } from 'date-fns';
import { CalendarEvent } from '@/activities/calendar/types/CalendarEvent';
export const getCalendarEventEndDate = (
calendarEvent: Pick<CalendarEvent, 'endsAt' | 'isFullDay' | 'startsAt'>,
) => calendarEvent.endsAt ?? endOfDay(calendarEvent.startsAt);