Default datetime inputs to current date/time
This commit is contained in:
parent
229ada83e1
commit
dc5e52d9ce
@ -1033,3 +1033,10 @@ document.addEventListener("click", (ev) => {
|
|||||||
inlined == "1" ? "0" : "1";
|
inlined == "1" ? "0" : "1";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
let now = new Date();
|
||||||
|
document.querySelectorAll(".prefill-now").forEach((el) => {
|
||||||
|
el.value = now.toFormat("yyyy-LL-dd'T'HH:mm:ss");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@ -155,7 +155,7 @@
|
|||||||
<div class="control">
|
<div class="control">
|
||||||
<label class="label collapses">
|
<label class="label collapses">
|
||||||
Time*
|
Time*
|
||||||
<input class="input" type="datetime-local" step="1" name="time">
|
<input class="input prefill-now" type="datetime-local" step="1" name="time">
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user