LesFruitsDefendus / saskatoon-ng

The new generation Saskatoon harverst management system
GNU Affero General Public License v3.0
10 stars 24 forks source link

Add end_date > start_date validation in harvest form #366

Open 2ynn opened 1 year ago

2ynn commented 1 year ago

Type of Issue: Feature request

Current behavior

harvest.end_date is used to determine whether a harvest is still open to registration or not. However only the end time is being displayed on the public calendar and no validation insures end_date > start_date. This can cause a lot of confusion if start date and end date don't happen to match and lead to volunteers not being able to register even though the harvest shows in yellow and in the future on the calendar. Additionally the end_date is not displayed on the harvest detail page, only in the form itself (i.e. harvests are assumed to last no longer than one day).

Suggested changes

Add form validation on end_date

Note: although it is safe to assume that regular picks typically happen the same day (i.e. a time picker could be used for selecting only the end time), the end date is useful in the case of fruit groups.