svsticky / constipated-koala

Management system for our study association
https://koala.svsticky.nl/
GNU General Public License v3.0
16 stars 4 forks source link

Whole day support #1104

Open SilasPeters opened 3 weeks ago

SilasPeters commented 3 weeks ago

Currently, we do not allow creating an activity as lasting whole-day, by explicitly marking it as such. Currently, we do so by leaving the times out. However, this is a cause for ambiguity and less readable code. We should allow marking a day as whole-day with a checkbox

Siem2l commented 3 weeks ago

Given that this logic is already implemented, it would be preferable to add a helper function for this purpose. This approach avoids refactoring the existing code and mitigates the risk of breaking backward compatibility. Additionally, adding a checkbox will introduce a new column to the database, which aligns with your understanding of the issue.

However, the issue itself is somewhat ambiguous. The first sentence addresses the admin UI, while the latter part discusses code readability. Are you aiming to resolve the UI aspect, code readability, or both?

Here's a short example of how you might implement the helper function:

def open?
  is_enrollable && (!open_present? || DateTime.now > when_open)
end