mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 07:55:52 +01:00
✨ Add new config format
Should be WAAAAY easier to work with modules now
This commit is contained in:
@@ -21,12 +21,7 @@ export const DateModule: IModule = {
|
||||
export default function DateComponent(props: any) {
|
||||
const [date, setDate] = useState(new Date());
|
||||
const { config } = useConfig();
|
||||
const hours = date.getHours();
|
||||
const minutes = date.getMinutes();
|
||||
const isFullTime =
|
||||
config.settings[`${DateModule.title}.full`] === undefined
|
||||
? true
|
||||
: config.settings[`${DateModule.title}.full`];
|
||||
const isFullTime = config?.modules?.[DateModule.title]?.options?.full?.value ?? false;
|
||||
const formatString = isFullTime ? 'HH:mm' : 'h:mm A';
|
||||
// Change date on minute change
|
||||
// Note: Using 10 000ms instead of 1000ms to chill a little :)
|
||||
|
||||
Reference in New Issue
Block a user