fix(dashboard): #163 month selection on first load
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 5m18s
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 5m18s
This commit is contained in:
@@ -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)
|
return nil, fmt.Errorf("could not parse timestamp: %w", service.ErrBadRequest)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
month = time.Now()
|
month = time.Now().UTC()
|
||||||
}
|
}
|
||||||
|
|
||||||
summary, err := handler.d.Summary(r.Context(), user, month)
|
summary, err := handler.d.Summary(r.Context(), user, month)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ templ Dashboard(summary *types.DashboardMonthlySummary) {
|
|||||||
<input
|
<input
|
||||||
name="month"
|
name="month"
|
||||||
type="date"
|
type="date"
|
||||||
class="input"
|
class="input datetime"
|
||||||
value={ summary.Month.String() }
|
value={ summary.Month.String() }
|
||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ function updateTime() {
|
|||||||
const newDate = value.includes("UTC") ? new Date(value) : value;
|
const newDate = value.includes("UTC") ? new Date(value) : value;
|
||||||
el.valueAsDate = newDate;
|
el.valueAsDate = newDate;
|
||||||
}
|
}
|
||||||
|
el.classList.remove("datetime");
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user