mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 21:03:29 +00:00
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:
committed by
GitHub
parent
1a08b39b8b
commit
a5e733246d
@@ -26,3 +26,14 @@ export const showLeadingZeros: ParamField = {
|
||||
type: 'boolean',
|
||||
defaultValue: false,
|
||||
};
|
||||
|
||||
export type TimeOptions = {
|
||||
timeformat: string | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper to get value of 'timeformat' from either source, prioritizing defaultValues
|
||||
*/
|
||||
export function getTimeOptionsFromParams(searchParams: URLSearchParams, defaultValues?: URLSearchParams) {
|
||||
return defaultValues?.get('timeformat') ?? searchParams.get('timeformat');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user