diff --git a/src/bin/update_server-icon.rs b/src/bin/update_server-icon.rs index ec09845..c2a14b2 100644 --- a/src/bin/update_server-icon.rs +++ b/src/bin/update_server-icon.rs @@ -111,10 +111,13 @@ fn get_festival(config_toml: &ConfigToml)-> FestivalData { }; for festival in &config_toml.festivals { - if (day >= festival.start.day && day <= festival.end.day) - && (month >= festival.start.month && month <= festival.end.month ) - && (year >= festival.start.year && year <= festival.end.year) { - result.current = Some(festival.name.to_owned()); + if (day >= festival.start.day && day <= festival.end.day) && + (month >= festival.start.month && month <= festival.end.month ) { + if festival.start.year == 0 || festival.end.year == 0 { + 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 { result.exclusions.push(festival.name.to_owned()); }