breaking: convert offset > over-under

change offset direction and relabel to over-under
This commit is contained in:
Carlos Valente
2025-07-14 11:12:52 +02:00
parent 92a34cf135
commit 1e1f547ce1
18 changed files with 89 additions and 72 deletions
@@ -1,8 +1,8 @@
import { ViewSettings } from 'ontime-types';
export const viewsSettingsPlaceholder: ViewSettings = {
dangerColor: '#ED3333',
dangerColor: '#ff7300',
normalColor: '#ffffffcc',
overrideStyles: false,
warningColor: '#FFAB33',
warningColor: '#ffa528',
};
+25
View File
@@ -0,0 +1,25 @@
import { MaybeNumber } from 'ontime-types';
import { millisToString } from 'ontime-utils';
import { enDash } from './styleUtils';
/**
* Formats offset text
*/
export function getOffsetText(offset: MaybeNumber): string {
if (offset === null) {
return enDash;
}
let offsetText = '';
if (offset < 0) offsetText += '-';
if (offset > 0) offsetText += '+';
offsetText += millisToString(Math.abs(offset));
return offsetText;
}
export function getOffsetState(offset: MaybeNumber): 'ahead' | 'behind' | 'muted' | null {
if (offset === null) return null;
if (offset === 0) return 'muted';
return offset < 0 ? 'behind' : 'ahead';
}