Saturday, March 23, 2024
1 change · master
Resolved issues and error corrections
Corrects planning demo records so their start and end dates are always in the right order. This prevents demo data from failing validation on certain calendar days, making setup and testing more reliable.
Original PR description
In the demo data, we have two records with expressions like ```py start_date = datetime.today() - relativedelta(weeks=2, weekday=4) end_date = datetime.today() - relativedelta(weeks=2, weekday=5) ``` On 2024-03-23 (Saturday), these expressions give the values ```py start_date = datetime.date(2024, 3, 15) end_date = datetime.date(2024, 3, 9) ``` which makes a constraint checking `start_date < end_date` fail. In order to make the computation correct, the solution is to compute end_date like start_date and add an extra day, like in ```py start_date = datetime.today() - relativedelta(weeks=2, weekday=4) end_date = start_date + relativedelta(days=1) ```