Fix: tambah defaultValue untuk dateInput di dashboard.js

This commit is contained in:
mwpn
2025-12-19 05:29:39 +07:00
parent 8226c84603
commit 78c323a9fe

View File

@@ -772,17 +772,21 @@ document.addEventListener('DOMContentLoaded', async () => {
console.log('[Dashboard] Default date set to today:', state.date);
// Set dateInput value SECARA LANGSUNG untuk override browser cache/autofill
// Lakukan ini SEBELUM setupFilters() untuk memastikan value ter-set dengan benar
const dateInput = document.getElementById('filter-date');
if (dateInput) {
// Force set value dan attribute untuk override browser cache
dateInput.value = today;
dateInput.setAttribute('value', today); // Force set attribute juga
dateInput.setAttribute('value', today);
// Juga set property langsung untuk memastikan
dateInput.defaultValue = today;
console.log('[Dashboard] Date input set to:', today, 'actual value:', dateInput.value);
}
setTopbarDate();
initCharts();
// Setup filters SETELAH state.date sudah di-set
// Setup filters SETELAH state.date dan dateInput.value sudah di-set
setupFilters();
await loadLocations();
await loadGates();