Fix sunrise/sunset date off-by-one

This commit is contained in:
Joscha 2025-03-24 13:24:23 +01:00
parent c6f5e373da
commit 4ab15ab61a

View file

@ -29,7 +29,7 @@ pub async fn post(server: State<Server>, Form(form): Form<FormData>) -> somehow:
let first = civil::Date::new(year, month, 1)?;
let mut times = vec![];
for day in 1..=first.days_in_month() {
for day in 0..first.days_in_month() {
let date = first + day.days();
let (rise, set) = sunrise::sunrise_sunset(
form.latitude,