diff --git a/index.html b/index.html
index 443751c..7a7c6ea 100644
--- a/index.html
+++ b/index.html
@@ -233,15 +233,23 @@
// ------------
// Prefill form
- let dateNow = new Date();
- dateNow.setSeconds(0);
- dateNow.setMilliseconds(0);
+ function dateToISOStringLocal(date) {
+ function pad(n) {
+ if (n < 10) {
+ return '0' + n;
+ }
+ return '' + n;
+ }
+
+ return date.getFullYear() + '-' + pad(date.getMonth() + 1) + '-' + pad(date.getDate()) + 'T' + pad(date.getHours()) + ':' + pad(date.getMinutes());
+ }
+ let dateNow = dateToISOStringLocal(new Date());
if (document.getElementById('time_birth').value === '') {
- document.getElementById('time_birth').valueAsDate = dateNow;
+ document.getElementById('time_birth').value = dateNow;
}
if (document.getElementById('time_measurement').value === '') {
- document.getElementById('time_measurement').valueAsDate = dateNow;
+ document.getElementById('time_measurement').value = dateNow;
}
// --------------------------