fix empty but non-null date entries
Some checks failed
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled

This commit is contained in:
philipp 2024-07-22 21:56:47 +02:00
parent a62fd116ea
commit b1252e8d5c

View File

@ -362,10 +362,14 @@ ASKÖ Ruderverein Donau Linz", self.name),
} }
let halfprice = if let Some(member_since_date) = &self.member_since_date { let halfprice = if let Some(member_since_date) = &self.member_since_date {
let member_since_date = if let Ok(member_since_date) = NaiveDate::parse_from_str(member_since_date, "%Y-%m-%d")
NaiveDate::parse_from_str(member_since_date, "%Y-%m-%d").unwrap(); {
let halfprice_startdate = NaiveDate::from_ymd_opt(Local::now().year(), 7, 1).unwrap(); let halfprice_startdate =
member_since_date >= halfprice_startdate NaiveDate::from_ymd_opt(Local::now().year(), 7, 1).unwrap();
member_since_date >= halfprice_startdate
} else {
false
}
} else { } else {
false false
}; };