Files
tom goriunovandGitHub 1c025b26fb Add possibility to change timestamp format (#3201)
* add global setting to change between local and utc time

* add control to change time format on detailed views

* tweaks

* adapt uptime graphs to work with utc time from settings

* fix tests

* add maxDiffPixels for SearchResults test

* fix test
2026-01-05 13:19:47 +01:00

31 lines
641 B
TypeScript

import React from 'react';
import { useSettingsContext } from 'lib/contexts/settings';
import { Switch } from 'toolkit/chakra/switch';
const SettingsLocalTime = () => {
const settingsContext = useSettingsContext();
if (!settingsContext) {
return null;
}
const { isLocalTime, toggleIsLocalTime } = settingsContext;
return (
<Switch
id="local-time"
defaultChecked={ isLocalTime }
onChange={ toggleIsLocalTime }
direction="rtl"
justifyContent="space-between"
w="100%"
minH="34px"
>
Local time format
</Switch>
);
};
export default React.memo(SettingsLocalTime);