fix(timer): use local date for manual entry default instead of UTC

- Compute 'today' from local getFullYear/getMonth/getDate so timezones ahead of
  UTC no longer show the wrong default date in the manual entry form.
This commit is contained in:
Dries Peeters
2026-01-26 14:47:41 +01:00
parent 75d5cff4d2
commit dd1441c17d
+5 -2
View File
@@ -119,9 +119,12 @@
</div>
<script>
document.addEventListener('DOMContentLoaded', async function(){
// Default values for date/time to now
const today = new Date().toISOString().split('T')[0];
// Default values for date/time to now (use local date, not UTC, for timezones ahead of UTC)
const now = new Date();
const yyyy = now.getFullYear();
const monthPad = String(now.getMonth() + 1).padStart(2, '0');
const dayPad = String(now.getDate()).padStart(2, '0');
const today = `${yyyy}-${monthPad}-${dayPad}`;
const hh = String(now.getHours()).padStart(2,'0');
const mm = String(now.getMinutes()).padStart(2,'0');
const startDate = document.getElementById('start_date');