mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-21 23:19:09 +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
@@ -2,7 +2,11 @@ import { CustomFields, OntimeEvent } from 'ontime-types';
|
||||
import { use, useMemo } from 'react';
|
||||
import { useSearchParams } from 'react-router';
|
||||
|
||||
import { getTimeOption } from '../../common/components/view-params-editor/common.options';
|
||||
import {
|
||||
getTimeOption,
|
||||
getTimeOptionsFromParams,
|
||||
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';
|
||||
import { makeOptionsFromCustomFields } from '../../common/components/view-params-editor/viewParams.utils';
|
||||
@@ -55,7 +59,7 @@ type TimelineOptions = {
|
||||
mainSource: keyof OntimeEvent | null;
|
||||
hidePast: boolean;
|
||||
fixedSize: boolean;
|
||||
};
|
||||
} & TimeOptions;
|
||||
|
||||
/**
|
||||
* Utility extract the view options from URL Params
|
||||
@@ -69,6 +73,7 @@ function getOptionsFromParams(searchParams: URLSearchParams, defaultValues?: URL
|
||||
mainSource: getValue('main') as keyof OntimeEvent | null,
|
||||
hidePast: isStringBoolean(getValue('hidePast')),
|
||||
fixedSize: isStringBoolean(getValue('fixedSize')),
|
||||
timeformat: getTimeOptionsFromParams(searchParams, defaultValues),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user