Print

Zoho Deluge: Check Time Booking Slots

What?
Just wanted a note to get in my head the logic if checking a requested time slot isn't a double-booking (as in, the time slot doesn't overlap a previous booking.

How?
Given a date/time and a duration, we will work out the requested start and end time:
copyraw
req_StartTime = input.Date_Field;
req_Duration = 90;
bool_doubleBooked=false;
for each thisRecord in allRecords
{
	thisRecord_StartTime = thisRecord.req_StartTime ;
	thisRecord_EndTime = thisRecord.req_StartTime.addMinutes(req_Duration);
	if(v_StartDate = thisRecord_StartTime)||(v_StartDate = thisRecord_EndTime)
	{
		doubleBooked=true;
	}
}
  1.  req_StartTime = input.Date_Field; 
  2.  req_Duration = 90
  3.  bool_doubleBooked=false
  4.  for each thisRecord in allRecords 
  5.  { 
  6.      thisRecord_StartTime = thisRecord.req_StartTime ; 
  7.      thisRecord_EndTime = thisRecord.req_StartTime.addMinutes(req_Duration)
  8.      if(v_StartDate = thisRecord_StartTime)||(v_StartDate = thisRecord_EndTime) 
  9.      { 
  10.          doubleBooked=true
  11.      } 
  12.  } 
Category: Zoho :: Article: 661