mirror of
https://github.com/nasa/openmct.git
synced 2024-12-22 14:32:22 +00:00
return reactive isUTCBased
This commit is contained in:
parent
d0a77637c0
commit
a11fcc3231
@ -34,7 +34,8 @@ const DEFAULT_DURATION_FORMATTER = 'duration';
|
|||||||
* observeTimeSystem: () => void,
|
* observeTimeSystem: () => void,
|
||||||
* timeSystemKey: import('vue').Ref<string>,
|
* timeSystemKey: import('vue').Ref<string>,
|
||||||
* timeSystemFormatter: import('vue').Ref<() => void>,
|
* timeSystemFormatter: import('vue').Ref<() => void>,
|
||||||
* timeSystemDurationFormatter: import('vue').Ref<() => void>
|
* timeSystemDurationFormatter: import('vue').Ref<() => void>,
|
||||||
|
* isTimeSystemUTCBased: import('vue').Ref<boolean>
|
||||||
* }}
|
* }}
|
||||||
*/
|
*/
|
||||||
export function useTimeSystem(openmct, options) {
|
export function useTimeSystem(openmct, options) {
|
||||||
@ -47,6 +48,7 @@ export function useTimeSystem(openmct, options) {
|
|||||||
const timeSystemDurationFormatter = ref(
|
const timeSystemDurationFormatter = ref(
|
||||||
getFormatter(openmct, currentTimeSystem.durationFormat || DEFAULT_DURATION_FORMATTER)
|
getFormatter(openmct, currentTimeSystem.durationFormat || DEFAULT_DURATION_FORMATTER)
|
||||||
);
|
);
|
||||||
|
const isTimeSystemUTCBased = ref(currentTimeSystem.isUTCBased);
|
||||||
|
|
||||||
onBeforeUnmount(() => stopObservingTimeSystem?.());
|
onBeforeUnmount(() => stopObservingTimeSystem?.());
|
||||||
|
|
||||||
@ -62,13 +64,15 @@ export function useTimeSystem(openmct, options) {
|
|||||||
openmct,
|
openmct,
|
||||||
timeSystem.durationFormat || DEFAULT_DURATION_FORMATTER
|
timeSystem.durationFormat || DEFAULT_DURATION_FORMATTER
|
||||||
);
|
);
|
||||||
|
isTimeSystemUTCBased.value = timeSystem.isUTCBased;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
observeTimeSystem,
|
observeTimeSystem,
|
||||||
timeSystemKey,
|
timeSystemKey,
|
||||||
timeSystemFormatter,
|
timeSystemFormatter,
|
||||||
timeSystemDurationFormatter
|
timeSystemDurationFormatter,
|
||||||
|
isTimeSystemUTCBased
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user