You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/config/booking-data.md
+49-48Lines changed: 49 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,39 +14,38 @@ description: You can learn about the cards config in the documentation of the DH
14
14
15
15
~~~jsx {}
16
16
data: [
17
-
{
18
-
id: string | number,
19
-
title: string,
20
-
category?: string,
21
-
subtitle?: string,
22
-
details?: string,
23
-
preview?: string, // link to image
24
-
price?: string,
25
-
review?: {
26
-
stars: number,
27
-
count: number,
28
-
},
29
-
slots: [
30
-
{
31
-
from: number | string, // hours from 0 to 24
32
-
to: number | string, // hours from 0 to 24
33
-
size?: number, // length of slot in minutes
34
-
gap?: number, // gap between slots in minutes
35
-
days?: array, // days of week for which rule can be applied from 0 to 6
36
-
dates?: array, // exact dates for which rule can be applied, timestamps
37
-
},
38
-
],
39
-
40
-
availableSlots?: [
41
-
{
42
-
id: string|number,
43
-
time:[number, number] //timestamp, length in minutes
44
-
},
45
-
],
46
-
usedSlots?: number[], //timestamps
47
-
slotSize?: number, //minutes
48
-
slotGap?: number, //minutes
49
-
},
17
+
{
18
+
id: string | number,
19
+
title: string,
20
+
category?: string,
21
+
subtitle?: string,
22
+
details?: string,
23
+
preview?: string, // link to image
24
+
price?: string,
25
+
review?: {
26
+
stars: number,
27
+
count: number
28
+
},
29
+
slots: [
30
+
{
31
+
from: number | string, // hours from 0 to 24
32
+
to: number | string, // hours from 0 to 24
33
+
size?: number, // length of slot in minutes
34
+
gap?: number, // gap between slots in minutes
35
+
days?: array, // days of week for which rule can be applied from 0 to 6
36
+
dates?: array, // exact dates for which rule can be applied, timestamps
37
+
}
38
+
],
39
+
availableSlots?: [
40
+
{
41
+
id: string|number,
42
+
time:[number, number] //timestamp, length in minutes
43
+
},
44
+
],
45
+
usedSlots?: number[], //timestamps
46
+
slotSize?: number, //minutes
47
+
slotGap?: number //minutes
48
+
}
50
49
];
51
50
~~~
52
51
@@ -67,14 +66,15 @@ For each card object you can specify the following parameters:
67
66
-`slots` - (required) an array of objects with the following parameters for each slot object:
68
67
-`from` - (required) a slot start time in hours from 0 to 24
69
68
-`to` - (required) a slot end time in hours from 0 to 24
70
-
-`size` - (optional) the duration of one slot in minutes
69
+
-`size` - (optional) the duration of one slot in minutes
71
70
-`gap` - (optional) the gap between slots in minutes; 0 is set by default
72
71
-`days` - (optional) days of the week when a slot is available for booking; possible values: from 0 to 6 where 0 is Sunday and 6 is Saturday; if no days are specified, all days are applied by default; if days are specified, the slot parameters (**to**, **from**, **size**, **gap**) defined for these days will be applied
73
-
-`dates` - (optional) an array of timestamps in milliseconds which are exact dates when a slot is available; the slot parameters (**to**, **from**, **size**, **gap**) for these specified dates will be applied
72
+
-`dates` - (optional) an array of timestamps in milliseconds which are exact dates when a slot is available; the slot parameters (**to**, **from**, **size**, **gap**) for these specified dates will be applied
73
+
74
74
:::note
75
-
Slot parameters specified for days will override common parameters defined for all days.
76
-
Slot parameters specified for dates will override parameters defined for specific days and all days.
77
-
If several slots objects are created for the same day, make sure that slots time ranges (from and to) with **different** size and gap do not overlap, otherwise all slots data for these days will not be applied.
75
+
Slot parameters specified for days will override common parameters defined for all days.
76
+
Slot parameters specified for dates will override parameters defined for specific days and all days.
77
+
If several slots objects are created for the same day, make sure that slots time ranges (from and to) with **different** size and gap do not overlap, otherwise all slots data for these days will not be applied.
78
78
:::
79
79
80
80
-`availableSlots` - (optional) an array of timestamps of available slots in milliseconds; if available slots are specified here, all slots from the `slots` array are ignored (i.e., become unavailable); each object in the array has the next parameters:
@@ -86,7 +86,7 @@ If several slots objects are created for the same day, make sure that slots time
86
86
87
87
### Example
88
88
89
-
~~~jsx
89
+
~~~jsx{}
90
90
constdata= [
91
91
{
92
92
id:"5cf364d8-9997-4d8c-9586-48f90f3cb736",
@@ -99,15 +99,15 @@ const data = [
99
99
price:"37 $",
100
100
review: {
101
101
star:1,
102
-
count:40,
102
+
count:40
103
103
},
104
104
slots: [
105
105
{
106
106
//a common slot rule for all days except those specified for the days and dates below
107
107
from:14,
108
108
to:17,
109
109
size:30,
110
-
gap:10,
110
+
gap:10
111
111
},
112
112
{
113
113
//this rule is applied to days 2 and 5 (Tuesdays and Fridays) except
@@ -116,7 +116,7 @@ const data = [
116
116
to:17,
117
117
size:50,
118
118
gap:20,
119
-
days: [2, 5],
119
+
days: [2, 5]
120
120
},
121
121
{
122
122
//this rule is applied to days 3 and 4 (Wednesdays and Thursdays) and exact date
Copy file name to clipboardExpand all lines: docs/api/config/booking-filtershape.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,14 +17,14 @@ filterShape: {
17
17
text?: boolean | [{
18
18
id: string,
19
19
label?: string,
20
-
suggest?: boolean,
20
+
suggest?: boolean
21
21
}],
22
22
date?: boolean,
23
23
time?: boolean | [{
24
24
from: number | string,
25
25
to: number | string,
26
-
label?: string,
27
-
}],
26
+
label?: string
27
+
}],
28
28
autoApply?: boolean
29
29
};
30
30
~~~
@@ -33,7 +33,7 @@ filterShape: {
33
33
34
34
-`text` - (optional) if **true**, the text input field is displayed (default); if **false**, the text field is hidden
35
35
-`id` - (required) the id of a card
36
-
-`suggest` - (required) if **true**, the auto-complete is enabled and the values (from the [`data`](/api/config/booking-data) object) that match a user's input text will be displayed
36
+
-`suggest` - (required) if **true**, the auto-complete is enabled and the values (from the [`data`](/api/config/booking-data) object) that match a user's input text will be displayed
37
37
-`label` - (optional) the label for the property from the `data` object. See [Default config](#default-config) below.
38
38
-`date` - (optional) shows/hides the date field; **true** is set by default (the field is shown)
39
39
-`time` - (optional) shows/hides the time field. If set to **true**, it takes an array of objects with default time options for a slot. For each object you can specify the following parameters:
@@ -49,18 +49,18 @@ If the `time` parameters are not set, the default values are applied: see [Defau
0 commit comments