Availability filters
The find time algorithm is a powerful tool to find availability by slicing data in mutiple ways using filters.
Quicklinks
And/Or filters:
- Between timestamps
- Business hours
- Daytime
- Only weekend
- Exclude weekends
- Specific day and time
- Specific time
- Specific day
Filter types
Filters are conditional rules that can exclude or include time slots based on different use cases. There are 3 types of filters:
-
OR filters Will include the resulting timeslots from any of the supplied filters. If you supply two filters with timeslots that doesn't overlap, they will both be added to the result. Consider it equivalent of coding an OR in a conditional statement (Filter1Result OR Filter2Result OR Filter3Result ...).
-
AND filters Will only include timeslots that fit within all of the supplied filters. Timeslots resulting from two different filters must overlap both filters to be included in the result. Consider it the equivalent of coding an AND in a conditional statement (Filter1Result AND Filter2Result AND Filter3Result ...)
Notes
You can use '10:30' or just '10' if you want it to be 10:30 or just 10
Full example
This includes all the filters applied in one request, primarily meant as a quick syntax reference:
json{
"emails": [
"doc.brown@timekit.io",
"marty.mcfly@timekit.io"
],
"filters": {
"or": [
{ "specific_day": {"day": "Monday"} },
{ "specific_day_and_time": {"day": "Wednesday", "start": 10, "end": 12, "timezone": "Europe/Copenhagen"}},
{ "between_timestamps": {"start": "2016-05-26T15:30:00+00:00", "end": "2016-05-28T18:00:00+00:00"}},
{ "exclude_weekend": {} },
{ "only_weekend": {} },
{ "specific_time": {"start": 9, "end": 15} }
],
"and": [
{ "business_hours": {"timezone": "America/Los_angeles"} },
{ "daytime": {"timezone": "Europe/Copenhagen"}}
]
},
"future": "1 months",
"length": "15 mins",
"sort": "asc"
}
Between timestamps filter
Can be used to find all solutions between two timestamp. The filter takes 3 arguments:
| Argument | Description | Required | Example |
|---|---|---|---|
| start | The start timestamp of the filter | yes | "2016-05-26T15:30:00+00:00" |
| end | The end timestamp of the filter | yes | "2016-05-28T18:00:00+00:00" |
| timezone | Set timezone | no | "Europe/Copenhagen" |
json"filters": {
"and": [
{ "between_timestamps": {"start": "2016-05-26T15:30:00+02:00", "end": "2016-05-28T18:00:00+02:00", "timezone": "Europe/Copenhagen"}}
]
}
Business hours filter
Can be used to find all solutions in business hours (9 - 18 (6pm)) in a certain timezone.
| Argument | Description | Required | Example |
|---|---|---|---|
| timezone | The timezone the business should be in | no - Default will be the timezone in the request headers | "America/Los_angeles" |
json"filters": {
"and": [
{ "business_hours": {"timezone": "America/Los_angeles"} },
{ "business_hours": {"timezone": "Europe/Copenhagen"} }
]
}
Daytime filter
Will only show options where its daytime (7 - 23 (11pm)) in the given timezone
| Argument | Description | Required | Example |
|---|---|---|---|
| timezone | The timezone the business should be in | no - Default will be the timezone in the request headers | "America/Los_angeles" |
json"filters": {
"and": [
{ "daytime": {"timezone": "America/Los_angeles"} },
{ "daytime": {"timezone": "Europe/Copenhagen"} }
]
}
Exclude weekends filter
If you need to filter out weekends (Saturdays & Sundays) you can use this filter. It takes a single argument
| Argument | Description | Required | Example |
|---|---|---|---|
| timezone | The timezone | no - default is the timezone in the header request | "Europe/Copenhagen" |
json"filters": {
"and": [
{ "exclude_weekend": {}}
]
}
Only weekend filter
If you only need timeslots in the weekend use this filter. The filter takes a single argument:
| Argument | Description | Required | Example |
|---|---|---|---|
| timezone | Only weekend of the given timezone | no - default is the timezone in the header request | "Europe/Copenhagen" |
This simple filter will only give you timeslots in the weekend of the given timezone!
json"filters": {
"and": [
{ "only_weekend": {}}
]
}
Specific day and time filter
If you only need timeslots for a specific day and time, you can use this filter. The filter takes 3 argument:
| Argument | Description | Required | Example |
|---|---|---|---|
| day | The day you need timeslots for | yes | "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" or "Sunday" |
| start | The start hour for this filter (in 24 hour format) | yes | 10 |
| end | The end hour for this filter (in 24 hour format) | yes | 12 |
json"filters": {
"and": [
{ "specific_day_and_time": {"day": "Monday", "start": 10, "end": 12}}
]
}
This will give you all timestamps on mondays between 10 & 12.
Specific time filter
If you only need timeslots for a specific time interval, you can use this filter. The filter takes a single argument:
| Argument | Description | Required | Example |
|---|---|---|---|
| start | The start hour for this filter (in 24 hour format) | yes | 10 |
| end | The end hour for this filter (in 24 hour format) | yes | 12 |
| timezone | That timezone the start & end hour should make | no - default from the request headers | "Europe/Copenhagen" |
json"filters": {
"and": [
{ "specific_time": {"start": 10, "end": 12}}
]
}
Specific day filter
If you only need timeslots for a specific day, you can use this filter. The filter takes a single argument:
| Argument | Description | Required | Example |
|---|---|---|---|
| day | The day you need timeslots for | yes | "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" or "Sunday" |
json"filters": {
"and": [
{ "specific_day": {"day": "Monday"}}
]
}
If you need either monday or friday you can do this:
json"filters": {
"or": [
{ "specific_day": {"day": "Monday"}},
{ "specific_day": {"day": "Friday"}}
]
}