diff --git a/package.json b/package.json
index 4c1d29909..002df8b6f 100644
--- a/package.json
+++ b/package.json
@@ -67,9 +67,12 @@
"dockerode": "^3.3.2",
"fily-publish-gridstack": "^0.0.13",
"framer-motion": "^10.0.0",
+ "geo-tz": "^7.0.7",
"html-entities": "^2.3.3",
"i18next": "^22.5.1",
"js-file-download": "^0.4.12",
+ "moment": "^2.29.4",
+ "moment-timezone": "^0.5.43",
"next": "13.4.10",
"next-i18next": "^13.0.0",
"nzbget-api": "^0.0.3",
diff --git a/public/locales/en/modules/date.json b/public/locales/en/modules/date.json
index 3f925d2d5..1a9e36efc 100644
--- a/public/locales/en/modules/date.json
+++ b/public/locales/en/modules/date.json
@@ -6,6 +6,27 @@
"title": "Settings for Date and Time widget",
"display24HourFormat": {
"label": "Display full time (24-hour)"
+ },
+ "dateFormat": {
+ "label": "Date formatting",
+ "data": {
+ "hide": "Hide Date"
+ }
+ },
+ "enableTimezone": {
+ "label": "Display a custom Timezone"
+ },
+ "timezoneLocation": {
+ "label": "Timezone Location"
+ },
+ "titleState": {
+ "label": "City title",
+ "info": "In case you activate the Timezone option, the name of the city and the timezone code can be shown.
You can also show the city alone or even show none.",
+ "data": {
+ "both": "City and Timezone",
+ "city": "City only",
+ "none": "None"
+ }
}
}
}
diff --git a/src/components/Dashboard/Tiles/Widgets/WidgetsEditModal.tsx b/src/components/Dashboard/Tiles/Widgets/WidgetsEditModal.tsx
index 0d7cbcfb4..574a76b4a 100644
--- a/src/components/Dashboard/Tiles/Widgets/WidgetsEditModal.tsx
+++ b/src/components/Dashboard/Tiles/Widgets/WidgetsEditModal.tsx
@@ -19,13 +19,13 @@ import { IconAlertTriangle, IconPlaylistX, IconPlus } from '@tabler/icons-react'
import { Trans, useTranslation } from 'next-i18next';
import { FC, useState } from 'react';
-import { InfoCard } from '../../../InfoCard/InfoCard';
import { useConfigContext } from '../../../../config/provider';
import { useConfigStore } from '../../../../config/store';
import { mapObject } from '../../../../tools/client/objects';
import Widgets from '../../../../widgets';
import type { IDraggableListInputValue, IWidgetOptionValue } from '../../../../widgets/widgets';
import { IWidget } from '../../../../widgets/widgets';
+import { InfoCard } from '../../../InfoCard/InfoCard';
import { DraggableList } from './Inputs/DraggableList';
import { LocationSelection } from './Inputs/LocationSelection';
import { StaticDraggableList } from './Inputs/StaticDraggableList';
@@ -148,15 +148,17 @@ const WidgetOptionTypeSwitch: FC<{
onChange={(ev) => handleChange(key, ev.currentTarget.checked)}
{...option.inputProps}
/>
- {info && }
+ {info && }
);
case 'text':
return (
- {t(`descriptor.settings.${key}.label`)}
- {info && }
+
+ {t(`descriptor.settings.${key}.label`)}
+
+ {info && }
- {t(`descriptor.settings.${key}.label`)}
- {info && }
+
+ {t(`descriptor.settings.${key}.label`)}
+
+ {info && }
);
case 'select':
+ const items = typeof option.data === 'function' ? option.data() : option.data;
+ const data = items.map((dataType) => {
+ return !dataType.label
+ ? {
+ value: dataType.value,
+ label: t(`descriptor.settings.${key}.data.${dataType.value}`),
+ }
+ : dataType;
+ });
return (
- {t(`descriptor.settings.${key}.label`)}
- {info && }
+
+ {t(`descriptor.settings.${key}.label`)}
+
+ {info && }