Add time copy button, improve session editing
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-09-18 20:21:05 +02:00
parent f151730ab6
commit c5653977ff
4 changed files with 7 additions and 1 deletions

View File

@ -8,6 +8,9 @@ for (let button of document.querySelectorAll("[data-target]")) {
event.preventDefault();
if (type == "now") {
targetElement.value = toISOUTCString(new Date);
} else if (type == "copy") {
const oppositeName = targetElement.name == "timestamp_start" ? "timestamp_end" : "timestamp_start";
document.querySelector(`[name='${oppositeName}']`).value = targetElement.value;
} else if (type == "toggle") {
if (targetElement.type == "datetime-local") targetElement.type = "text";
else targetElement.type = "datetime-local";