fix: format clock from preset (#2066)

* fix: format clock from preset

* fix: add to all views

* chore: format

* refactor: return flat value from common.options.ts
This commit is contained in:
Alex Christoffer Rasmussen
2026-05-03 18:43:58 +02:00
committed by GitHub
parent 1a08b39b8b
commit a5e733246d
14 changed files with 84 additions and 37 deletions
+4 -1
View File
@@ -6,8 +6,10 @@ import { useSearchParams } from 'react-router';
import type { SelectOption } from '../../common/components/select/Select';
import {
getTimeOption,
getTimeOptionsFromParams,
hideTimerSeconds,
showLeadingZeros,
TimeOptions,
} from '../../common/components/view-params-editor/common.options';
import { OptionTitle } from '../../common/components/view-params-editor/constants';
import { ViewOption } from '../../common/components/view-params-editor/viewParams.types';
@@ -194,7 +196,7 @@ type TimerOptions = {
font?: string;
keyColour?: string;
timerColour?: string;
};
} & TimeOptions;
/**
* Utility extract the view options from URL Params
@@ -229,6 +231,7 @@ function getOptionsFromParams(searchParams: URLSearchParams, defaultValues?: URL
font: getValue('font') ?? undefined,
keyColour: makeColourString(getValue('keyColour')),
timerColour: makeColourString(getValue('timerColour')),
timeformat: getTimeOptionsFromParams(searchParams, defaultValues),
};
}