aboutsummaryrefslogtreecommitdiff
path: root/modern
diff options
context:
space:
mode:
Diffstat (limited to 'modern')
-rw-r--r--modern/src/settings/MaintenancePage.jsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/modern/src/settings/MaintenancePage.jsx b/modern/src/settings/MaintenancePage.jsx
index 2161e7eb..491a0d3b 100644
--- a/modern/src/settings/MaintenancePage.jsx
+++ b/modern/src/settings/MaintenancePage.jsx
@@ -70,7 +70,7 @@ const MaintenancePage = () => {
const rawToValue = (start, value) => {
const attribute = positionAttributes[item.type];
- if (item.type.endsWith('Time')) {
+ if (item.type?.endsWith('Time')) {
if (start) {
return dayjs(value).locale('en').format('YYYY-MM-DD');
}
@@ -91,7 +91,7 @@ const MaintenancePage = () => {
const valueToRaw = (start, value) => {
const attribute = positionAttributes[item.type];
- if (item.type.endsWith('Time')) {
+ if (item.type?.endsWith('Time')) {
if (start) {
return dayjs(value, 'YYYY-MM-DD').valueOf();
}
@@ -147,7 +147,7 @@ const MaintenancePage = () => {
</Select>
</FormControl>
<TextField
- type={item.type.endsWith('Time') ? 'date' : 'number'}
+ type={item.type?.endsWith('Time') ? 'date' : 'number'}
value={rawToValue(true, item.start) || ''}
onChange={(e) => setItem({ ...item, start: valueToRaw(true, e.target.value) })}
label={labels.start ? `${t('maintenanceStart')} (${labels.start})` : t('maintenanceStart')}