aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modern/src/settings/MaintenancePage.jsx11
-rw-r--r--modern/src/settings/MaintenancesPage.jsx6
2 files changed, 8 insertions, 9 deletions
diff --git a/modern/src/settings/MaintenancePage.jsx b/modern/src/settings/MaintenancePage.jsx
index 87f8ea0b..2161e7eb 100644
--- a/modern/src/settings/MaintenancePage.jsx
+++ b/modern/src/settings/MaintenancePage.jsx
@@ -73,10 +73,10 @@ const MaintenancePage = () => {
if (item.type.endsWith('Time')) {
if (start) {
return dayjs(value).locale('en').format('YYYY-MM-DD');
- } else {
- return value / 86400000;
}
- } else if (attribute && attribute.dataType) {
+ return value / 86400000;
+ }
+ if (attribute && attribute.dataType) {
switch (attribute.dataType) {
case 'speed':
return speedFromKnots(value, speedUnit);
@@ -94,10 +94,9 @@ const MaintenancePage = () => {
if (item.type.endsWith('Time')) {
if (start) {
return dayjs(value, 'YYYY-MM-DD').valueOf();
- } else {
- return value * 86400000;
}
- } else if (attribute && attribute.dataType) {
+ return value * 86400000;
+ } if (attribute && attribute.dataType) {
switch (attribute.dataType) {
case 'speed':
return speedToKnots(value, speedUnit);
diff --git a/modern/src/settings/MaintenancesPage.jsx b/modern/src/settings/MaintenancesPage.jsx
index 9170f9ee..9241eb3e 100644
--- a/modern/src/settings/MaintenancesPage.jsx
+++ b/modern/src/settings/MaintenancesPage.jsx
@@ -48,10 +48,10 @@ const MaintenacesPage = () => {
if (key.endsWith('Time')) {
if (start) {
return dayjs(value).locale('en').format('YYYY-MM-DD');
- } else {
- return `${value / 86400000} ${t('sharedDays')}`;
}
- } else if (attribute && attribute.dataType) {
+ return `${value / 86400000} ${t('sharedDays')}`;
+ }
+ if (attribute && attribute.dataType) {
switch (attribute.dataType) {
case 'speed':
return formatSpeed(value, speedUnit, t);