mirror of
https://github.com/cjfranko/NTP-Timeturner.git
synced 2025-11-08 10:22:02 +00:00
feat: Autofill date input with system date, prevent user overwrite
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
parent
cfc9a79ab8
commit
3374646de5
1 changed files with 5 additions and 0 deletions
|
|
@ -90,6 +90,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
statusElements.systemClock.textContent = data.system_clock;
|
||||
statusElements.systemDate.textContent = data.system_date;
|
||||
|
||||
// Autofill the date input, but don't overwrite user edits.
|
||||
if (!lastApiData || dateInput.value === lastApiData.system_date) {
|
||||
dateInput.value = data.system_date;
|
||||
}
|
||||
|
||||
const ntpIconInfo = iconMap.ntpActive[!!data.ntp_active];
|
||||
if (data.ntp_active) {
|
||||
statusElements.ntpActive.innerHTML = `<img src="${ntpIconInfo.src}" class="status-icon" alt="" title="${ntpIconInfo.tooltip}"><span>Active</span>`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue