diff --git a/apps/client/src/common/hooks/useSocket.ts b/apps/client/src/common/hooks/useSocket.ts index 449148944..cc10945d4 100644 --- a/apps/client/src/common/hooks/useSocket.ts +++ b/apps/client/src/common/hooks/useSocket.ts @@ -202,6 +202,9 @@ export const useStartTimesOverview = createSelector((state: RuntimeStore) => ({ plannedStart: state.rundown.plannedStart, actualStart: state.rundown.actualStart, plannedEnd: state.rundown.plannedEnd, +})); + +export const useRundownExpectedEnd = createSelector((state: RuntimeStore) => ({ expectedEnd: state.offset.expectedRundownEnd, })); diff --git a/apps/client/src/common/utils/__tests__/time.test.ts b/apps/client/src/common/utils/__tests__/time.test.ts index 429300f7d..be11e0ded 100644 --- a/apps/client/src/common/utils/__tests__/time.test.ts +++ b/apps/client/src/common/utils/__tests__/time.test.ts @@ -43,8 +43,8 @@ describe('formatTime()', () => { describe('formatDuration()', () => { it('formats durations correctly', () => { - expect(formatDuration(0)).toBe('0h 0m'); - expect(formatDuration(-5000)).toBe('0h 0m'); + expect(formatDuration(0)).toBe('0m'); + expect(formatDuration(-5000)).toBe('0m'); expect(formatDuration(MILLIS_PER_MINUTE)).toBe('1m'); expect(formatDuration(6 * MILLIS_PER_MINUTE + 11 * MILLIS_PER_SECOND)).toBe('6m'); expect(formatDuration(MILLIS_PER_MINUTE * 10)).toBe('10m'); diff --git a/apps/client/src/common/utils/time.ts b/apps/client/src/common/utils/time.ts index 109436962..fc5bb6c9f 100644 --- a/apps/client/src/common/utils/time.ts +++ b/apps/client/src/common/utils/time.ts @@ -112,7 +112,7 @@ export const formatTime = ( export function formatDuration(duration: number, hideSeconds = true): string { // durations should never be negative, we handle it here to flag if there is an issue in future if (duration <= 0) { - return '0h 0m'; + return '0m'; } const hours = Math.floor(duration / MILLIS_PER_HOUR); diff --git a/apps/client/src/features/control/playback/playback-timer/PlaybackTimer.module.scss b/apps/client/src/features/control/playback/playback-timer/PlaybackTimer.module.scss index 1fd3fdbdb..972b37618 100644 --- a/apps/client/src/features/control/playback/playback-timer/PlaybackTimer.module.scss +++ b/apps/client/src/features/control/playback/playback-timer/PlaybackTimer.module.scss @@ -58,7 +58,6 @@ height: 1.5rem; display: flex; gap: $section-spacing; - margin-left: 1.5rem; } .tag { @@ -70,6 +69,7 @@ .time { color: $section-white; font-size: $text-body-size; + display: inline-block; } .rolltag { diff --git a/apps/client/src/features/operator/operator-event/OperatorEvent.module.scss b/apps/client/src/features/operator/operator-event/OperatorEvent.module.scss index 0de360990..994bbf740 100644 --- a/apps/client/src/features/operator/operator-event/OperatorEvent.module.scss +++ b/apps/client/src/features/operator/operator-event/OperatorEvent.module.scss @@ -81,6 +81,7 @@ .plannedStart { font-size: 1.5rem; margin-right: 0.5rem; + display: inline; } .timeUntil { diff --git a/apps/client/src/features/operator/operator-event/OperatorEvent.tsx b/apps/client/src/features/operator/operator-event/OperatorEvent.tsx index c2e77add3..cd415407e 100644 --- a/apps/client/src/features/operator/operator-event/OperatorEvent.tsx +++ b/apps/client/src/features/operator/operator-event/OperatorEvent.tsx @@ -1,11 +1,12 @@ import { memo, RefObject, SyntheticEvent } from 'react'; import { useLongPress } from '@mantine/hooks'; -import { MILLIS_PER_MINUTE, MILLIS_PER_SECOND, millisToString } from 'ontime-utils'; +import { MILLIS_PER_MINUTE, MILLIS_PER_SECOND } from 'ontime-utils'; import DelayIndicator from '../../../common/components/delay-indicator/DelayIndicator'; import { cx, getAccessibleColour } from '../../../common/utils/styleUtils'; -import { formatDuration, useTimeUntilExpectedStart } from '../../../common/utils/time'; +import { formatDuration, formatTime, useTimeUntilExpectedStart } from '../../../common/utils/time'; import RunningTime from '../../viewers/common/running-time/RunningTime'; +import SuperscriptPeriod from '../../viewers/common/superscript-time/SuperscriptPeriod'; import type { EditEvent, Subscribed } from '../operator.types'; import style from './OperatorEvent.module.scss'; @@ -64,22 +65,24 @@ function OperatorEvent({ const mouseHandlers = useLongPress(handleLongPress); const cueColours = colour && getAccessibleColour(colour); - const operatorClasses = cx([ - style.event, - isSelected && style.running, - isPast && style.past, - ]); + const operatorClasses = cx([style.event, isSelected && style.running, isPast && style.past]); return ( -