Migrated from Redmine #443 | Author: Arian Hojat Status: Closed | Priority: Normal | Created: 2019-11-13
I’m sending this to the API in prod to try to get SimplyBook records that were created between 2pm to 4pm (EST) today on the 13th:
$array=(
‘order’=>‘record_date’,
‘created_date_from’=>‘2019-11-13’,
‘created_date_to’=>‘2019-11-13’,
‘time_from’=>‘14:00:00’,
‘time_to’=>‘16:00:00’
);
$bookings = $client->getBookings ($arr);
I’m getting some weird results in this order:
Result 0: record_date: 2019-11-13 14:31:30
Result 1: record_date: 2019-11-13 08:11:15
Result 2: record_date: 2019-11-13 01:16:30
Result 3: record_date: 2019-11-13 01:15:25
Result 4: record_date: 2019-11-13 00:55:53
Is created_date different than the record_date? I’m not sure what record_date actually is if its returning 12:55:53am. Is it not the ‘date created’ that I’m searching on?
If its different can you explain the difference between both.
Note: If record_date is different, then having created_date show up here in this API call would be useful.
whoops this isn’t a bug but more a support ticket. Can’t edit the ticket type.
PS My guess is that created_date_from/to isn’t really meant to be combined with time_from/time_to ( and only date_from/date_to is meant to be combined with it [aka the actual appt time]).
I was hoping it could dynamically switch if you were actually looking for a created_date range… I think it would be good to add a created_time_from/to that I can combine with created_date_from/to do hourly updates via cron which is what my business is requesting.
Note: I still don’t get why that ‘2019-11-13 00:55:53’ record is coming through. Is this an ‘OR’ when i use all these variables?
like does my query become:
(
‘created_date_from’ >= ‘2019-11-13
AND
created_date_to’ <= ‘2019-11-13’
)
OR
( //note: this is the appointment’s time, not the created_date’s time:
‘time_from’ > ‘14:00:00’
AND
‘time_to’=>‘16:00:00’
)
created_date_from is booking creation date filter
time_from is booking time filter (has no relation to creation time)
you can use this filters together if you need
We don’t have created time filters for now. If you need it then the only way to solve this is to get list by date filters and then filter it by time by your script.
We don’t have created time filters for now. If you need it then the only way to solve this is to get list by date filters and then filter it by time by your script.
Darn, k got it. Add it onto a small feature list for this API if you can :). That or maybe to just accept and use a full ‘Y-m-d H:i:s’ format in either created_date_from/to or date_from/to so user can supply that ‘Y-m-d H:i:s’ or fallback and use ‘Y-m-d’ if user supplies that.