Home›Forums›General Support – NOT for Volunteer and PTA plugins!›PTA Sign Up sheet user can sign up for 2 concurrent tasks
Tagged: overlapping time periods
- This topic has 4 replies, 2 voices, and was last updated 8 years, 11 months ago by Stephen Sherrard.
-
AuthorPosts
-
-
December 18, 2015 at 4:15 PM #7911Cyrelle GersonParticipant
The event setup page has the following choice:
Allow Duplicate Signup Times? Check this to allow a volunteer to signup for more than one task (in this sheet) with overlapping time ranges.
When I leave this unchecked, a user is still able to sign up for 2 different tasks that are scheduled for overlapping time periods. I was expecting that leaving this choice unchecked would prevent that from happening.
What is the behavior that should happen? I would like to prevent users from signing up for 2 tasks with overlapping time periods.
Thanks.
-
December 18, 2015 at 4:23 PM #7915Stephen SherrardKeymaster
Are the tasks within the same sheet? That function only checks for overlaps for tasks within the same sheet. Also, there needs to be a start time and an end time for each task. If any of the tasks don’t have both start and end times, then those are not checked, as you need both a start time and an end time to define a time range. End times also need to be after the start times.
Start and end times are converted to unix timestamps and then compared with simple math operators.
-
December 18, 2015 at 4:37 PM #7917Cyrelle GersonParticipant
Yes, the tasks are on the same sheet. There are start and end times on both tasks. End times are after the start times.
I have WordPress 4.4 installed and most recent version of your plugin.
Thanks.
-
December 19, 2015 at 4:49 AM #7921Cyrelle GersonParticipant
I figured out what why it wasn’t working. One of the tasks runs from 7:30PM to 10:00PM. The other task runs from 8:00PM to 1:00 AM the next morning. But when you put in the 2nd task in the form that way, it must think that 1:00 AM is the same day and is before 8:00PM, therefore not a valid time period. Changing the end of the 2nd event to 11:55PM fixed the problem.
However, in real life the event ends at 1:00 AM the next day. Might there be a way to modify the task form so that you can have a task that starts on one day and ends the next day? I am using the multi-day event type.
Thanks.
-
-
December 19, 2015 at 5:39 PM #7923Stephen SherrardKeymaster
There is not a simple way to change that behavior without screwing up everyone who is already using this plugin. Dates and times are stored separately, and the times were really for display only until this new check for overlaps function.
I could probably figure something out, by throwing in some extra checks to see if the end time is less than the beginning time, and then adding 24 hours to it (to make it the next day) before converting it to a unix timestamp for the overlap comparisons.
-
-
AuthorPosts
- You must be logged in to reply to this topic.