Fix: tambah defaultValue untuk dateInput di dashboard.js
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user