Skip to main content
Question

Formula for Calendar Time Block (Start Time + Duration)

  • June 3, 2019
  • 0 replies
  • 89 views

I have what I think is a simple question, but I cannot create a working formula.
I need to have blocked off times for individuals on a calendar.
I have an event start time for individuals in a form with two separate date and time fields. I have successfully combined them into a single Date & Time field using the Date/Time Formula:
ToTimestamp([Date of Event], [Time of Event]) (2:30pm on 6/5/2019 for instance)

But I also have on the form a Duration field for the event (so 2.5 hours for instance).

But now I need to have my calendar show that time blocked off for the full duration, from the start time of 2:30 until 5pm.
But when I try to add it in, it gives me syntax errors, and I have tried several different approaches.

The one that seems to be the closest is:
ToTimestamp([Date of Event], [Time of Event]) + [Duration of Event Formula]
"Duration of Event Formula" = [Total Event Duration] from the form as type Duration.
But that only seems to move my start time on the calendar 2.5 hours ahead from 2:30pm so it shows a start time of 5pm.

How do I get this formula to work so that I can keep my form with the separate Date & Time fields, and incorporate the duration of the event to show up on my calendar correctly?



This topic has been closed for replies.

  • Registered
  • June 3, 2019
Try wrapping your duration in Hours(). You might also have to call ToTimeOfDay on the time field, depends what type of field it is.

So something like this, as long as the duration is numeric. Might have to play around with it a bit but this should do it. I was getting some weird highlighting in QuickBase on the word Duration so you might shorten that or change it. Might not matter.

ToTimestamp([Date of Event], [Time of Event])  + Hours([Duration of Event Formula])

I'm not sure how it behaves when you feed it something like 2.5 instead of 1 or 2 so it might actually fail.

Eli,
Can you tell me your formula for your end date/time?  It seems to me from your post that you made a formula for the start date/time when you wanted to make a formula for the end date/time.