Hi Wix staff,
Regarding this issue I did some digging and I realised that the problem come from getServiceAvailability( ) and not my code.
What is happening is that getServiceAvailability returns maximum 25 slots for a given timeframe
let today = new Date();
let startRange = new Date();
let endRange = new Date();
startRange.setDate(today.getDate() + 7); // one week from now
endRange.setDate(today.getDate() + 30*7); // two weeks from now
let options = {
startDateTime: startRange,
endDateTime: endRange
};
let serviceID ="..."; // service available every monday for 1 hour
wixBookings.getServiceAvailability(servideID, options).then(result => {
console.log(result.slots);
// will only display 25 slots
})
That’s fine if you have a service with few availability because you rarely want to make and appointment far in the future but imaging:
a service with 10 availabilities per day (every 30 minutes), you can barely query availabilities for 2-and-half days…
I’m pretty sure it’s related to recent changes in the wix booking API because I was able to query more 100 slots a month ago.
Moreover that limit is not stated in the doc getServiceAvailability( ).
-
Is this a known issue? (plz don’t tell “it’s not a bug but a feature”)
-
Are you planning to fix it soon?
Thx you