Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-Arc committed Jan 8, 2025
1 parent c69ef74 commit efde7b8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
2 changes: 1 addition & 1 deletion apps/client/src/views/timeline/timeline.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function useScopedRundown(rundown: OntimeRundown, selectedEventId: MaybeS
let selectedIndex = selectedEventId ? Infinity : -1;
let firstStart = null;
let totalDuration = 0;
let lastEntry: PlayableEvent | null = null;
let lastEntry: PlayableEvent | undefined;

for (let i = 0; i < rundown.length; i++) {
const currentEntry = rundown[i];
Expand Down
18 changes: 1 addition & 17 deletions packages/utils/src/date-utils/checkIsNextDay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,10 @@ import { dayInMs } from './conversionUtils.js';

/**
* Utility function checks whether a given event is the day after from its predecessor
* We consider an event to be the day after, if it begins on a new day
* @example day after
* 09:00 - 10:00
* 08:00 - 10:30
* @example day after
* 23:00 - 00:00
* 02:00 - 03:00
* @example same day
* 09:00 - 10:00
* 09:30 - 10:30
* @example same day, but previous crosses midnight
* 23:00 - 01:00
* 02:00 - 03:00
* @example same day, but previous crosses midnight (with overlap)
* 22:00 - 02:00
* 01:00 - 03:00
*/
export function checkIsNextDay(
current: Pick<OntimeEvent, 'timeStart' | 'dayOffset'>,
previous?: Pick<OntimeEvent, 'timeStart' | 'duration' | 'dayOffset'> | null,
previous?: Pick<OntimeEvent, 'timeStart' | 'duration' | 'dayOffset'>,
): boolean {
if (!previous) {
return false;
Expand Down
3 changes: 1 addition & 2 deletions packages/utils/src/date-utils/getTimeFromPrevious.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import type { OntimeEvent } from 'ontime-types';
import { dayInMs } from './conversionUtils.js';

/**
* Utility returns the time elapsed (gap or overlap) from the previous
* It uses deconstructed parameters to simplify implementation in UI
* Utility returns the gap from previous event
*/
export function getTimeFromPrevious(
current: Pick<OntimeEvent, 'timeStart' | 'dayOffset'>,
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/date-utils/isNewLatest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { dayInMs } from './conversionUtils.js';
*/
export function isNewLatest(
currentEvent: Pick<OntimeEvent, 'timeStart' | 'duration' | 'dayOffset'>,
previousEvent?: Pick<OntimeEvent, 'timeStart' | 'duration' | 'dayOffset'> | null,
previousEvent?: Pick<OntimeEvent, 'timeStart' | 'duration' | 'dayOffset'>,
) {
// true if there is no previous
if (!previousEvent) {
Expand Down

0 comments on commit efde7b8

Please sign in to comment.