fix(dashboard): #163 month selection on first load
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 5m18s

This commit is contained in:
2025-06-16 12:52:49 +02:00
parent 6b8059889d
commit 00d7296dc2
3 changed files with 3 additions and 2 deletions

View File

@@ -81,7 +81,7 @@ func (handler IndexImpl) dashboard(user *types.User, htmx bool, r *http.Request)
return nil, fmt.Errorf("could not parse timestamp: %w", service.ErrBadRequest)
}
} else {
month = time.Now()
month = time.Now().UTC()
}
summary, err := handler.d.Summary(r.Context(), user, month)

View File

@@ -9,7 +9,7 @@ templ Dashboard(summary *types.DashboardMonthlySummary) {
<input
name="month"
type="date"
class="input"
class="input datetime"
value={ summary.Month.String() }
/>
</form>

View File

@@ -17,6 +17,7 @@ function updateTime() {
const newDate = value.includes("UTC") ? new Date(value) : value;
el.valueAsDate = newDate;
}
el.classList.remove("datetime");
})
}