fix: was being too strict in matching the year
This commit is contained in:
parent
a7423959dc
commit
ffd6e40d0b
1 changed files with 7 additions and 4 deletions
|
@ -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) {
|
||||
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());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue