Comment 1 for bug 1960535

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Would this design allow for there to be multiple entries for each day? Making the split hours function much easier? And support 3+ open chunks in a day?

Would this make it easier to mesh with the closed dates feature also?

I've often wished for there to be a set of DB functions to make the open/closed status of an org easier to access in custom scripts. I think this design change would make that easier to do.

Things like this, that would take into account open days and set closed holidays from the closed days editor.
OrgOpenNow(102); --bool is org open right now
OrgOpenToday(102); --bool is org open today at any time.
OrgOpenOn(102,'2022-02-11'::timestamp); --bool, is org open on specified date or timesamp.
OrgNextOpen(102); --Next open timestamp for org
OrgNextClosed(102); --When does the org close next, useful for same day/in library use hourly checkouts being due at next closing time.
OrgNextOpenDays(102, 7); --Return date equal to 7 open days from now for org unit. For hold shelf time for instance. Or for due dates for items.

It would be great to have any easy way to only run a cron job if a location is open. Or to be able to add open date and time logic to action_trigger processing.

Anyway, +1 for me