Skip to content

Commit fba35c4

Browse files
authored
Merge pull request #2 from DHTMLX/next
merge next to master
2 parents beb3352 + 116470c commit fba35c4

71 files changed

Lines changed: 8346 additions & 5080 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<h1 align="center"><a href="https://docs.dhtmlx.com/booking/">DHTMLX Booking Documentation</a></h1>
1+
<h1 align="center"><a href="https://docs-next.dhtmlx.com/booking/">DHTMLX Booking Documentation</a></h1>
22

3-
New Booking description here
3+
JavaScript Booking library is a ready-made component designed to be easily incorporated into your application. It provides end-users with functionality for scheduling appointments online with wide search options. The widget is made responsive and optimised for mobile devices.
44

55
## Explore documentation locally
66

@@ -27,13 +27,13 @@ $ yarn start
2727

2828
## Related sources
2929

30-
[Download DHTMLX Booking](https://dhtmlx.com/docs/products/dhtmlxBooking/download.shtml)
30+
[Download DHTMLX Booking](https://dhtmlx.com/docs/products/dhtmlxBooking/)
3131

32-
[Live demos](https://snippet.dhtmlx.com/)
32+
[Live demos](https://snippet.dhtmlx.com/d7w3jtqz?tag=booking)
3333

3434
[Blog](https://dhtmlx.com/blog/)
3535

36-
[Forum](https://forum.dhtmlx.com/)
36+
[Forum](https://forum.dhtmlx.com/c/widgets/)
3737

3838
## Follow us
3939

@@ -47,4 +47,4 @@ Follow us on [Twitter](https://twitter.com/dhtmlx) :feet:
4747

4848
Like our page on [Facebook](https://www.facebook.com/dhtmlx/) :thumbsup:
4949

50-
See our news on [Linkedin](https://www.linkedin.com/groups/3345009/) :mega:
50+
See our news on [Linkedin](https://www.linkedin.com/groups/3345009/) :mega:

docs/api/api_overview.md

Lines changed: 0 additions & 69 deletions
This file was deleted.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
sidebar_label: cardShape
3+
title: cardShape
4+
description: You can learn about the cardShape config in the documentation of the DHTMLX JavaScript Booking library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Booking.
5+
---
6+
7+
# cardShape
8+
9+
### Description
10+
11+
@short: Optional. An object with settings for managing information displayed on the left side of cards
12+
13+
### Usage
14+
15+
~~~jsx {}
16+
cardShape?: {
17+
category?: boolean,
18+
details?: boolean,
19+
preview?: boolean,
20+
price?: boolean,
21+
review?: boolean,
22+
subtitle?: boolean,
23+
title?: boolean
24+
};
25+
~~~
26+
27+
### Parameters
28+
29+
To configure the card appearance, in the **cardShape** object you can specify the following parameters (fields):
30+
31+
- `category` - (optional) shows/hides a card's name
32+
- `details` - (optional) shows/hides details
33+
- `preview` - (optional) shows/hides a preview image
34+
- `price` - (optional) shows/hides price
35+
- `review` - (optional) shows/hides rating information
36+
- `subtitle` - (optional) shows/hides a card's subtitle
37+
- `title` - (optional) shows/hides a card's title
38+
39+
### Default config
40+
41+
~~~jsx {}
42+
const defaultCardShape = {
43+
category: true,
44+
details: true,
45+
preview: true,
46+
price: true,
47+
review: true,
48+
subtitle: false,
49+
title: true
50+
};
51+
~~~
52+
53+
### Example
54+
55+
~~~jsx {}
56+
const cardShape = {
57+
review: false,
58+
subtitle: false,
59+
price: false
60+
};
61+
62+
new booking.Booking("#root", {
63+
cardShape,
64+
// other parameters
65+
});
66+
~~~
67+
68+
The snippet below demonstrates how to configure what to display on the left side of cards:
69+
70+
<iframe src="https://snippet.dhtmlx.com/6mxd7918?mode=result" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>

docs/api/config/booking-data.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
---
2+
sidebar_label: data
3+
title: data
4+
description: You can learn about the cards config in the documentation of the DHTMLX JavaScript Booking library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Booking.
5+
---
6+
7+
# data
8+
9+
### Description
10+
11+
@short: Optional. An array of objects containing the cards data
12+
13+
### Usage
14+
15+
~~~jsx {}
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+
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+
}
49+
];
50+
~~~
51+
52+
### Parameters
53+
54+
For each card object you can specify the following parameters:
55+
56+
- `id` - (required) the ID of a card
57+
- `title` - (required) the title of a card (e.g., a specialist's name)
58+
- `category` - (optional) the category name of a card (e.g., a specialist's job)
59+
- `subtitle` - (optional) the subtitle of a card
60+
- `details` - (optional) other details of a card
61+
- `preview` - (optional) a card preview which is the link to the card image
62+
- `price` - (optional) the price of the service
63+
- `review` - (optional) rating information that includes the following parameters:
64+
- `stars` - (optional) the number of rating stars (out of five)
65+
- `count` - (optional) the number of reviews
66+
- `slots` - (required) an array of objects with the following parameters for each slot object:
67+
- `from` - (required) a slot start time in hours from 0 to 24
68+
- `to` - (required) a slot end time in hours from 0 to 24
69+
- `size` - (optional) the duration of one slot in minutes
70+
- `gap` - (optional) the gap between slots in minutes; 0 is set by default
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
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+
:::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.
78+
:::
79+
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:
81+
- `id` - (required) the id of a slot
82+
- `time` - (required) an array that includes timestamp and slot duration in minutes
83+
- `usedSlots` - (optional) an array of timestamps of booked slots in milliseconds
84+
- `slotSize` - (optional) the duration of a slot in minutes; the value will be applied to all slots of this card if other value is not set inside the `slots` object; *60* minutes is set by default
85+
- `slotGap` - (optional) the gap between slots in minutes that is set for all slots in the current card; this value is applied if any other value is not specified inside the `slots` object; 0 is set by default
86+
87+
### Example
88+
89+
~~~jsx {}
90+
const data = [
91+
{
92+
id: "5cf364d8-9997-4d8c-9586-48f90f3cb736",
93+
title: "Debra Weeks",
94+
category: "Allergist",
95+
subtitle: "7 years of experience",
96+
details:
97+
"Silverstone Medical Center (Vanderbilt Avenue 13, Chestnut, New Zealand)",
98+
preview: "https://snippet.dhtmlx.com/codebase/data/booking/01/img/01.jpg",
99+
price: "37 $",
100+
review: {
101+
star: 1,
102+
count: 40
103+
},
104+
slots: [
105+
{
106+
//a common slot rule for all days except those specified for the days and dates below
107+
from: 14,
108+
to: 17,
109+
size: 30,
110+
gap: 10
111+
},
112+
{
113+
//this rule is applied to days 2 and 5 (Tuesdays and Fridays) except
114+
//the Friday from the slot object below
115+
from: 12,
116+
to: 17,
117+
size: 50,
118+
gap: 20,
119+
days: [2, 5]
120+
},
121+
{
122+
//this rule is applied to days 3 and 4 (Wednesdays and Thursdays) and exact date
123+
from: 18,
124+
to: 20,
125+
size: 45,
126+
gap: 20,
127+
days: [3, 4],
128+
dates: [ 1683234000000 ] // exact upcoming date (May 5, 2023, Friday)
129+
}
130+
]
131+
}
132+
];
133+
134+
new booking.Booking("#root", {
135+
data,
136+
// other parameters
137+
});
138+
~~~
139+
140+
**Related articles:** [Defining slot rules](/guides/configuration#defining-slot-rules)

docs/api/config/booking-end.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
sidebar_label: end
3+
title: end
4+
description: You can learn about the end date in the documentation of the DHTMLX JavaScript Booking library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Booking.
5+
---
6+
7+
# end
8+
9+
### Description
10+
11+
@short: Optional. Defines the date until which to show available slots
12+
13+
### Usage
14+
15+
~~~jsx {}
16+
end?: Date;
17+
~~~
18+
19+
### Parameters
20+
21+
- `Date` - the end date until which to display available slots; the default value is one year from the current date.
22+
23+
### Example
24+
25+
~~~jsx {}
26+
new booking.Booking("#root", {
27+
data,
28+
end: new Date(2025, 11, 11),
29+
// other parameters
30+
});
31+
~~~
32+
33+
The snippet below shows how to set the [start](/api/config/booking-start) and end dates:
34+
35+
<iframe src="https://snippet.dhtmlx.com/cc28whe7?mode=result" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>

0 commit comments

Comments
 (0)