mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 18:33:53 +00:00
e9a7cd0400
* add dayOffset to OntimeEvent * refactor: isNewLatest * calculate totalDays * refactor: getTimeFromPrevious * add gap as dataset in OntimeEvent * use in ui * format overlap is just a simple text formatting, big test is not needed * add new fields where needed * update apply delay * show nex day eaven if there is no gap * create test * use buildin day offset in timeline * remove todo * consistent naming * make a calculateDayOffset util for rundownCache * refactor: checkIsNextDay to use dayOffset * spelling Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com> * remove unneeded test * remove todo * update test db * use data-testid * spelling Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com> * update comments * remove null option --------- Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
35 lines
913 B
TypeScript
35 lines
913 B
TypeScript
import { OntimeEvent, SupportedEvent } from 'ontime-types';
|
|
|
|
/**
|
|
* @description Creates a safe duplicate of an event
|
|
* @param {OntimeEvent} event
|
|
* @param {string} [after]
|
|
* @return {OntimeEvent} clean event
|
|
*/
|
|
type ClonedEvent = Omit<OntimeEvent, 'id' | 'cue'>;
|
|
export const cloneEvent = (event: OntimeEvent): ClonedEvent => {
|
|
return {
|
|
type: SupportedEvent.Event,
|
|
title: event.title,
|
|
note: event.note,
|
|
timeStart: event.timeStart,
|
|
duration: event.duration,
|
|
timeEnd: event.timeEnd,
|
|
timerType: event.timerType,
|
|
timeStrategy: event.timeStrategy,
|
|
countToEnd: event.countToEnd,
|
|
linkStart: event.linkStart,
|
|
endAction: event.endAction,
|
|
isPublic: event.isPublic,
|
|
skip: event.skip,
|
|
colour: event.colour,
|
|
revision: 0,
|
|
delay: 0,
|
|
dayOffset: 0,
|
|
gap: 0,
|
|
timeWarning: event.timeWarning,
|
|
timeDanger: event.timeDanger,
|
|
custom: {},
|
|
};
|
|
};
|