Booked Scheduler Community Support
July 20, 2018, 04:28:34 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Booked 2.7 beta has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: help with API - availableAt  (Read 37 times)
cbrherms
Newbie
*

Karma: 0
Posts: 3


« on: July 13, 2018, 02:13:03 PM »

Hi all!

I've written / mashed together a little php/html webpage that pulls in information regarding a specific schedule we have and plops it in to a table which displays which of our studios are free, when the next booking is, and if they aren't free right now then when the next free start time is.

Problem i've got though is that the returned "availableAt" value for a resource via the API shows the start time of a blocked time for today.
To explain it better, an example:
On a friday we have hourly slots between 9am and 5pm.
We are fully booked in one of our studios today. 2 bookings over the time periods of 0900-1300 and 1300-1700.
A user is unable to place a booking at 5pm as it is the start of the blocked time period (1700-0000).
YET....
a GetAvailability api call on this resource returns an availableAt value of today at 5pm, even when this is not bookable so should not be available......

Anyone else had this issue?
I'm still on 2.6.8 so i'm hoping it may be fixed in 2.7.1 but cannot test at the moment.
If it's not, I may have to see if there's any way I can modify the logic for this call.
Logged
lucap
Newbie
*

Karma: 0
Posts: 14


« Reply #1 on: July 16, 2018, 11:15:28 AM »

Hi
I am not sure if this is a bug or if we are missing something, but I have the same problem. Both on 2.6.8 and 2.7.1.
Here another user http://php.brickhost.com/forums/index.php?topic=15142.0.

When I call reservation API, the timezone is always +0000 in all fields.
However the API description says the timezone is the current timezone of the date parameter or the browser timezone.

I never asked on the forum but I resolve the issue with a little update to the logic, like this:

I changed line 61 in WebServices/Responses/ReservationItemResponse.php
from
$this->startDate = $reservationItemView->StartDate->ToIso();
to
$this->startDate = $reservationItemView->StartDate->ToTimezone($server->GetSession()->Timezone)->ToIso();

You can change it in every model you need it.

LucaP
Logged
cbrherms
Newbie
*

Karma: 0
Posts: 3


« Reply #2 on: Today at 10:17:36 AM »

Sadly did not seem to change the availableAt response on a get availability call =/
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!