diff --git a/src/main/resources/static/js/helper.js b/src/main/resources/static/js/helper.js new file mode 100644 index 0000000..b307231 --- /dev/null +++ b/src/main/resources/static/js/helper.js @@ -0,0 +1,30 @@ +resetValue = function(selector, value) { + $(selector).val(value); + $(selector).change(); + return false; +} + +nowPlus = function(summand) { + const roundToQuarter = date => new Date(Math.round(date / 9e5) * 9e5); + var now = roundToQuarter(new Date()); + var wanted = new Date(now); + wanted.setMinutes(now.getMinutes() + summand); + return wanted.toLocaleTimeString('de', { + hour12: false, + hour: "numeric", + minute: "numeric" + }); +} + +validateTime = function(inputField, okButtonId) { + var value = inputField.value; + var regexPattern = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/; + var valid = value == "" ? true : regexPattern.test(value); + if (valid) { + $(inputField).css("background-color", "#cfc"); + $("[id='" + okButtonId + "']").removeAttr('disabled'); + } else { + $(inputField).css("background-color", "#fcc"); + $("[id='" + okButtonId + "']").attr('disabled', 'disabled'); + } +} \ No newline at end of file diff --git a/src/main/resources/templates/done/item.html b/src/main/resources/templates/done/item.html index ada8682..d58826f 100644 --- a/src/main/resources/templates/done/item.html +++ b/src/main/resources/templates/done/item.html @@ -10,7 +10,7 @@
-
+
@@ -24,44 +24,84 @@
-
- +
+ +
+
+ + + + + + + + + + +
-
- +
+ +
+
+ + + + + + + + + + +
- +
+ +
+
+ TODO: suggestions +
- +
+ +
+
TODO: suggestions
- +
+ +
+
TODO: suggestions
- +
+ +
+
TODO: suggestions
Änderung
- + abbrechen