fix: was being too strict in matching the year

This commit is contained in:
silver 2025-06-07 22:29:00 +01:00
parent a7423959dc
commit ffd6e40d0b
Signed by: silver
GPG key ID: 36F93D61BAD3FD7D

View file

@ -111,10 +111,13 @@ fn get_festival(config_toml: &ConfigToml)-> FestivalData {
}; };
for festival in &config_toml.festivals { for festival in &config_toml.festivals {
if (day >= festival.start.day && day <= festival.end.day) if (day >= festival.start.day && day <= festival.end.day) &&
&& (month >= festival.start.month && month <= festival.end.month ) (month >= festival.start.month && month <= festival.end.month ) {
&& (year >= festival.start.year && year <= festival.end.year) { if festival.start.year == 0 || festival.end.year == 0 {
result.current = Some(festival.name.to_owned()); result.current = Some(festival.name.to_owned());
} else if (year >= festival.start.year && year <= festival.end.year) {
result.current = Some(festival.name.to_owned());
}
} else if !festival.all_year { } else if !festival.all_year {
result.exclusions.push(festival.name.to_owned()); result.exclusions.push(festival.name.to_owned());
} }