diff --git a/Webserver/Templates/dashboard/irrigationJob.html b/Webserver/Templates/dashboard/irrigationJob.html
index d552487..662ac50 100644
--- a/Webserver/Templates/dashboard/irrigationJob.html
+++ b/Webserver/Templates/dashboard/irrigationJob.html
@@ -2,6 +2,6 @@
{{ job.zone.number|string}}
{{job.zone.name }}
- {{ ((job.duration/60)|int)|string + " " + translater.getTranslation("minutes")}}
+ {{ ((job.duration/60))|string + " " + translater.getTranslation("minutes")}}
{{ translater.getTranslation("delete") }}
\ No newline at end of file
diff --git a/Webserver/Templates/dashboard/zone.html b/Webserver/Templates/dashboard/zone.html
index 6c4c044..3cfe7d6 100644
--- a/Webserver/Templates/dashboard/zone.html
+++ b/Webserver/Templates/dashboard/zone.html
@@ -36,7 +36,7 @@
- {{translater.getTranslation("irragation is planed for") }}
{{ translater.getTranslation("minutes") + "." }}
+ {{translater.getTranslation("irrigation is planed.") }} {{ translater.getTranslation("planed duration")}}:
{{ translater.getTranslation("minutes") + "." }}
{{ translater.getTranslation("delete") }}
diff --git a/Webserver/Translater.py b/Webserver/Translater.py
index c973bc2..7f79400 100644
--- a/Webserver/Translater.py
+++ b/Webserver/Translater.py
@@ -1,4 +1,6 @@
from enum import Enum
+from time import strftime
+from time import gmtime
class Language(Enum):
ENGLISH = 1
GERMAN = 2
@@ -27,7 +29,7 @@ class Translater:
"switch to automatic mode": "Auf Automatikbetrieb umstellen",
"minutes": "Minuten",
"until": "bis",
- "irragation is planed for": "Bewässerung ist geplant für",
+ "irrigation is planed.": "Bewässerung ist geplant.",
"planed irrigationjobs": "geplante Bewässerungsaufträge",
"planed duration": "geplante Dauer",
"cancel": "abbrechen",
@@ -45,3 +47,14 @@ class Translater:
return self.dict_german[english_String]
case _:
return "no translations for these language"
+
+ def formatTime(self, timeInt):
+ format = ""
+ match self.language:
+ case Language.ENGLISH:
+ format = "%I.%S %p"
+ case Language.GERMAN:
+ format = "%H:%M:%S"
+ case _:
+ format = ""
+ return strftime(format, gmtime(timeInt))
diff --git a/Webserver/static/js/dashboard.js b/Webserver/static/js/dashboard.js
index b62e95f..2d5e15b 100644
--- a/Webserver/static/js/dashboard.js
+++ b/Webserver/static/js/dashboard.js
@@ -4,7 +4,7 @@ function refreshZone(zone_json) {
document.getElementById("inner_icon_state_zone_" + zone.number).className = 'inner_icon ' + (zone.state ? 'dot_green' : 'dot_red');
document.getElementById("state_text_zone_" + zone.number).innerHTML = zone.state_text;
document.getElementById("end_time_row_zone_" + zone.number).style.display = ((zone.setState == 1 || zone.setState == 2) ? 'table-row' : 'none');
- document.getElementById("end_time_zone_" + zone.number).innerHTML = zone.endTimeSetState;
+ document.getElementById("end_time_zone_" + zone.number).innerHTML = zone.endTimeSetStateFormated;
document.getElementById("planed_duration_row_zone_" + zone.number).style.display = ((zone.planedDuration > 0) ? 'table-row' : 'none');
document.getElementById("planed_duration_zone" + zone.number).innerHTML = zone.planedDuration/60;
document.getElementById("inner_icon_mode_zone_" + zone.number).innerHTML = zone.autoMode ? 'A' : 'M';
diff --git a/Zone.py b/Zone.py
index 17eaa1d..b03ae5a 100644
--- a/Zone.py
+++ b/Zone.py
@@ -26,6 +26,7 @@ class Zone:
"state_text": translater.getTranslation("switched on" if self.state else "switched off"),
"setState": self.setState,
"endTimeSetState" : self.endTimeSetState,
+ "endTimeSetStateFormated" : translater.formatTime(self.endTimeSetState),
"planedDuration": self.planedDuration,
}