From 98294eea2f3c1408ef44522deb337b4fd63484b8 Mon Sep 17 00:00:00 2001 From: tbshag2 Date: Mon, 17 Mar 2025 17:40:34 +0300 Subject: [PATCH 01/13] [update] integration with scheduler added --- docs/guides/integration-with-widgets.md | 374 +++++++++++++++++++++++- 1 file changed, 362 insertions(+), 12 deletions(-) diff --git a/docs/guides/integration-with-widgets.md b/docs/guides/integration-with-widgets.md index 9d9800c..42c3cdb 100644 --- a/docs/guides/integration-with-widgets.md +++ b/docs/guides/integration-with-widgets.md @@ -1,27 +1,377 @@ --- -sidebar_label: Integration with DHTMLX widgets -title: Integration with DHTMLX widgets -description: You can learn about the integration with DHTMLX widgets 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. +sidebar_label: Integration with DHTMLX Scheduler +title: Integration with DHTMLX Scheduler +description: You can learn about the integration with DHTMLX Scheduler 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. --- -# Integration with DHTMLX widgets +# Integration with DHTMLX Scheduler -You can integrate DHTMLX Booking with such DHTMLX widgets as [Scheduler](https://docs.dhtmlx.com/scheduler/) and [Event Calendar](https://docs.dhtmlx.com/eventcalendar/). Check the examples below. +This guide will show how to integrate the DHTMLX Booking widget with DHTMLX Scheduler. -## Integration with DHTMLX Scheduler +## Main concepts - Please, also refer to [backend](https://github.com/DHTMLX/scheduler-booking-go). +The integration primarily focuses on converting the Scheduler data into Booking slots. - +- **Scheduler events vs. Booking slots:** + - Scheduler handles events (e.g., single or recurring). + - Booking generates available time slots from those events. + +So what you actually need is to generate booking slots from the schedule (the [snippet below](#example) shows how to generate booking slots from the doctor's schedule using JSON data). + +- **Recurring events limitation:** + - Booking supports only weekly recurring events (defined as INTERVAL=1;FREQ=WEEKLY in the Scheduler). + - Scheduler can handle any recurring pattern + +- **Timezone handling:** + - Booking interprets timestamps in the local timezone. + - You need to convert timestamps between global and local timezones before sending them to Booking (and vice versa). + +- **Slot creation strategy:** + - Use the `slots` and `usedSlots` properties to build the schedule, ensuring that used slots are excluded. + + +## Main steps for integration and rules for generating events + +We will show how how to generate booking slots from the doctor's schedule using JSON data. + +**Step 1. Retrieve the doctor's schedule data (e.g., /doctors/worktime), which may contain both recurring and single events.** + +Scheduler data example: + +~~~json +[ + { + "doctor_id": 1, + "start_date": "2025-03-18 02:00:00", + "end_date": "2025-03-18 06:00:00" + }, + { + "doctor_id": 1, + "start_date": "2025-03-13 09:00:00", + "end_date": "9999-02-01 00:00:00", + "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", + "duration": 28800 + }, + { + "doctor_id": 2, + "start_date": "2025-03-13 20:00:00", + "end_date": "9999-02-01 00:00:00", + "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=SA", + "duration": 28800 + } +] +~~~ + +**Step 2. Convert Scheduler events to Booking slots following the next rules.** + +**Rule 1:** Single event slot creation. + +For each single event in the schedule, convert the start and end times to Booking slots by creating an entry in the slots array, including the corresponding date (dates). + +Scheduler event: + +~~~json +{ + "doctor_id": 1, + "start_date": "2025-03-18 02:00:00", + "end_date": "2025-03-18 06:00:00" +} +~~~ + +Booking slot: + +~~~json +{ + "id": 1, + "slotSize": 20, + "slotGap": 5, + "slots": [ + { + "from": "02:00", + "to": "06:00", + "dates": [ + 1742256000000 // 2025-03-18 00:00:00 (timestamp) + ] + } + ] +} +~~~ + +**Rule 2:** Recurring events. + +For recurring events, we use a weekly pattern. The start and end dates must be the same for each occurrence, as Booking only supports weekly recurring slots. + +Scheduler event (weekly on weekdays): the recurrence rule (rrule) specifies that the event repeats weekly on Monday, Tuesday, Wednesday, Thursday, and Friday. + +~~~json +{ + "doctor_id": 1, + "start_date": "2025-03-13 09:00:00", + "end_date": "9999-02-01 00:00:00", + "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", + "duration": 28800 +} +~~~ + +Booking Slots: In Booking, the weekly schedule is represented as a single rule, with the same start and end times for all repeated events: + +~~~json +{ + "id": 1, + "slotSize": 20, + "slotGap": 5, + "slots": [ + { + "from": "09:00", + "to": "17:00", + "days": [1, 2, 3, 4, 5] // Monday to Friday + } + ] +} +~~~ + +**Rule 3:** Scheduling an event that spans multiple days. + +If an event spans across multiple days (e.g., starts at 8 PM and ends at 4 AM), it should be split into two slots — one for each day. + +For example, when a doctor's shift starts on Saturday evening and lasts into Sunday morning, Booking can only generate slots within one day. In this case, we need to split the event into two separate rules: one for Saturday and another for Sunday. + +Scheduler event: + +~~~json +{ + "doctor_id": 2, + "start_date": "2025-03-13 20:00:00", + "end_date": "9999-02-01 00:00:00", + "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=SA", + "duration": 28800 +} +~~~ + +Booking slot: + +~~~json +{ + "id": 2, + "slotSize": 45, + "slotGap": 5, + "slots": [ + { + "from": "20:00", + "to": "24:10", + "days": [6] // Saturday + }, + { + "from": "00:10", + "to": "04:00", + "days": [0] // Sunday + } + ] +} +~~~ -## Integration with DHTMLX Event Calendar +**Rule 4:** Additional single events added to recurring events. - Please, also refer to [backend](https://github.com/DHTMLX/event-calendar-booking-go). +In this case, a single event is added to a recurring schedule. The Booking slots are generated for both the recurring and the single events. The single event dates are added to the recurring event's dates array. - +Scheduler events: + +- Repeating event: Doctor’s availability from 9:00 AM to 5:00 PM on weekdays. +- Single event: Doctor is also available from 2:00 AM to 6:00 AM on March 18th and 19th. + +~~~json +[ + // recurring event + { + "doctor_id": 1, + "start_date": "2025-03-13 09:00:00", + "end_date": "9999-02-01 00:00:00", + "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", + "duration": 28800 + }, + + // single events + { + "doctor_id": 1, + "start_date": "2025-03-18 02:00:00", + "end_date": "2025-03-18 06:00:00" + }, + { + "doctor_id": 1, + "start_date": "2025-03-19 02:00:00", + "end_date": "2025-03-19 06:00:00" + } +] +~~~ + +Booking slots: + +- Merging events: The repeating event and single events are combined into one Booking rule. +- If the single event has priority, its specific dates (March 18th and 19th) are added to the repeating event's rule. +- If the single event needs to override the repeating one, it must not be added to the repeating event’s dates. + +~~~json +{ + "id": 1, + "slotSize": 20, + "slotGap": 20, + "slots": [ + { + "from": "02:00", + "to": "06:00", + "dates": [ + 1742256000000, // 2025-03-18 00:00:00 + 1742342400000 // 2025-03-19 00:00:00 + ] + }, + { + "from": "09:00", + "to": "17:00", + "days": [1, 2, 3, 4, 5], + "dates": [ + 1742256000000, // 2025-03-18 00:00:00 + 1742342400000 // 2025-03-19 00:00:00 + ] + } + ] +} +~~~ + +**Rule 5:** Modifying a single instance of an recurring event. + +If a single instance of a recurring event is edited (e.g., time change for a specific date), generate a new slot with the updated time and date in the dates array, overriding the days array. + +Scheduler event: + +~~~json +[ + { + "doctor_id": 1, + "start_date": "2025-03-13 09:00:00", + "end_date": "9999-02-01 00:00:00", + "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", + "duration": 28800 + }, + { + "doctor_id": 1, + "start_date": "2025-03-14 03:00:00", + "end_date": "2025-03-14 11:00:00", + "recurring_event_id": "1", + "original_start": "2025-03-14 09:00" + } +] +~~~ + +Booking slot: + +~~~json +{ + "id": 1, + "slotSize": 20, + "slotGap": 5, + "slots": [ + { + "from": "09:00", + "to": "17:00", + "days": [1, 2, 3, 4, 5] + }, + { + "from": "03:00", + "to": "11:00", + "dates": [ + 1741910400000 // 2025-03-14 03:00:00 (modified) + ] + } + ] +} +~~~ + +**Rule 6:** Deleting a single instance of a recurring event + +When a single occurrence is removed from a recurring event in Scheduler, we need to update Booking rules to reflect this removal. This is done by creating a special rule for the removed date, using an empty time interval and the dates property (which has higher priority than days). + +Scheduler event: + +~~~json +[ + { + "doctor_id": 5, + "start_date": "2025-03-14 09:00:00", + "end_date": "9999-02-01 00:00:00", + "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=TH,FR,SA,SU", + "duration": 28800 + }, + { + "doctor_id": 5, + "start_date": "2025-03-23 09:00:00", + "end_date": "2025-03-23 17:00:00", + "recurring_event_id": "15", + "original_start": "2025-03-23 09:00", + "deleted": true + } +] +~~~ + +Booking slot: + +~~~json +{ + "from": "09:00", + "to": "17:00", + "days": [4, 5, 6, 0] // Thursday to Sunday +}, +{ + "from": "00:00", + "to": "00:00", + "dates": [ + 1742688000000 // 2025-03-23 00:00:00 (deleted occurrence) + ] +} +~~~ + +**Rule 7:** Events starting later than Booking start date + +If a recurring event starts after the Booking start date (default is today), create rules with empty time intervals for the dates prior to the event's start date. This simulates the dates being "removed" from the recurrence. + +Scheduler event: + +~~~json +{ + "id": "ffbe7628-25f4-4cbe-9127-3bc779d6bafa", + "start_date": "2025-03-17 09:00:00", + "end_date": "9999-02-01 00:00:00", + "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=SU,MO,TU,WE,TH,FR,SA", + "duration": 28800 +} +~~~ + +Booking slots: + +~~~json +{ + "slots": [ + { "from": "09:00", "to": "17:00", "days": [0, 1, 2, 3, 4, 5, 6] }, + { "from": "00:00", "to": "00:00", "dates": [ + 1741906800000, // March 14, 2025 + 1741993200000, // March 15, 2025 + 1742079600000 // March 16, 2025 + ]} + ] +} +~~~ + +**Step 3. Timezone Conversion** + +Ensure that the timestamps are converted from global time to the local time of the user's timezone before sending them to Booking. This ensures correct slot display in the Booking widget. + + +## Example + +The snippet below demonstrates how to convert doctor schedules into booking slots. The doctors' schedules that include recurring and single-time events are fetched from the Scheduler widget via the `/doctors/worktime` URL, while the final booking slots generated from the scheduler data are provided by the `/units` URL. The slots are generated on the server-side. Please, also refer to [backend](https://github.com/DHTMLX/scheduler-booking-go). + + - From e34e9aeb413e3c007bce51d415b80af4d24cdf1f Mon Sep 17 00:00:00 2001 From: Tatiana Bogdevich <114931923+tbshag2@users.noreply.github.com> Date: Mon, 17 Mar 2025 18:03:26 +0300 Subject: [PATCH 02/13] Update integration-with-widgets.md --- docs/guides/integration-with-widgets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/integration-with-widgets.md b/docs/guides/integration-with-widgets.md index 42c3cdb..5bf9238 100644 --- a/docs/guides/integration-with-widgets.md +++ b/docs/guides/integration-with-widgets.md @@ -32,7 +32,7 @@ So what you actually need is to generate booking slots from the schedule (the [s ## Main steps for integration and rules for generating events -We will show how how to generate booking slots from the doctor's schedule using JSON data. +We will show how to generate booking slots from the doctor's schedule using JSON data. **Step 1. Retrieve the doctor's schedule data (e.g., /doctors/worktime), which may contain both recurring and single events.** From a2c5159cc2aa8ebfeec6072132ace465209619f4 Mon Sep 17 00:00:00 2001 From: tbshag2 Date: Tue, 18 Mar 2025 17:40:09 +0300 Subject: [PATCH 03/13] [update] integration with scheduler updated --- docs/guides/integration-with-widgets.md | 73 +++++++++---------------- 1 file changed, 27 insertions(+), 46 deletions(-) diff --git a/docs/guides/integration-with-widgets.md b/docs/guides/integration-with-widgets.md index 5bf9238..337276c 100644 --- a/docs/guides/integration-with-widgets.md +++ b/docs/guides/integration-with-widgets.md @@ -19,52 +19,39 @@ The integration primarily focuses on converting the Scheduler data into Booking So what you actually need is to generate booking slots from the schedule (the [snippet below](#example) shows how to generate booking slots from the doctor's schedule using JSON data). - **Recurring events limitation:** - - Booking supports only weekly recurring events (defined as INTERVAL=1;FREQ=WEEKLY in the Scheduler). - - Scheduler can handle any recurring pattern + - Booking supports only weekly recurring events (defined as INTERVAL=1;FREQ=WEEKLY in Scheduler). + - Scheduler can handle any recurring pattern so you will need to limit creating other recurring events in Scheduler config - **Timezone handling:** - Booking interprets timestamps in the local timezone. - - You need to convert timestamps between global and local timezones before sending them to Booking (and vice versa). + - If you use global timestamps, you need to convert them to local timezones before sending them to Booking (and vice versa before saving the data back). +For conversion instructions, refer to [Working with UTC data](/guides/configuration/saving-reservations/#working-with-utc-data). -- **Slot creation strategy:** - - Use the `slots` and `usedSlots` properties to build the schedule, ensuring that used slots are excluded. +- **Booking slot strategies:** + - Use `slots` and `usedSlots` to build the schedule, ensuring that used slots are excluded (we'll focus on this strategy) + - Use only `availableSlots`, which is suitable for events without recurrences. +## Example -## Main steps for integration and rules for generating events +The snippet below demonstrates how to integrate Booking with the Scheduler widget by converting doctors' schedules into booking slots. Key data endpoints used for integration: -We will show how to generate booking slots from the doctor's schedule using JSON data. +- `/doctors/worktime` - Scheduler data (doctor schedules) that includes recurring and single-time events. These events are used to create time slots for the Booking system. +- `/units` - final Booking slots generated from the Scheduler `worktime` data. The slots are generated on the server-side. Please, also refer to [backend](https://github.com/DHTMLX/scheduler-booking-go). +- `/doctors/reservations` - an auxiliary collection used to visualize `usedSlots` in the timeline view. This data comes from the Booking form, containing information about already reserved slots for doctors. +- `/doctors` - contains all doctors, including their names and IDs. It is used for displaying doctor information in both the Scheduler and Booking widgets. -**Step 1. Retrieve the doctor's schedule data (e.g., /doctors/worktime), which may contain both recurring and single events.** +Converting Scheduler events to Booking slots is the major part of integration and the rules for handling the events and converting them to slots are described in the [section below](#rules-for-converting-scheduler-events-to-booking-slots). -Scheduler data example: +We also ensure that the timestamps are converted correctly. When global (UTC) timestamps are used, they need to be converted to local time before loading them into the system (**l2g** function in the example). Similarly, before saving the data back, the timestamps should be converted from local time to global (UTC) time (**g2l** function in the example). -~~~json -[ - { - "doctor_id": 1, - "start_date": "2025-03-18 02:00:00", - "end_date": "2025-03-18 06:00:00" - }, - { - "doctor_id": 1, - "start_date": "2025-03-13 09:00:00", - "end_date": "9999-02-01 00:00:00", - "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", - "duration": 28800 - }, - { - "doctor_id": 2, - "start_date": "2025-03-13 20:00:00", - "end_date": "9999-02-01 00:00:00", - "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=SA", - "duration": 28800 - } -] -~~~ + + + +## Rules for converting Scheduler events to Booking slots -**Step 2. Convert Scheduler events to Booking slots following the next rules.** +We will show how to generate booking slots from the doctor's schedule using JSON data. -**Rule 1:** Single event slot creation. +**Rule 1. Single event slot creation.** For each single event in the schedule, convert the start and end times to Booking slots by creating an entry in the slots array, including the corresponding date (dates). @@ -97,7 +84,7 @@ Booking slot: } ~~~ -**Rule 2:** Recurring events. +**Rule 2. Recurring events.** For recurring events, we use a weekly pattern. The start and end dates must be the same for each occurrence, as Booking only supports weekly recurring slots. @@ -130,7 +117,7 @@ Booking Slots: In Booking, the weekly schedule is represented as a single rule, } ~~~ -**Rule 3:** Scheduling an event that spans multiple days. +**Rule 3. Scheduling an event that spans multiple days.** If an event spans across multiple days (e.g., starts at 8 PM and ends at 4 AM), it should be split into two slots — one for each day. @@ -170,7 +157,7 @@ Booking slot: } ~~~ -**Rule 4:** Additional single events added to recurring events. +**Rule 4. Additional single events added to recurring events.** In this case, a single event is added to a recurring schedule. The Booking slots are generated for both the recurring and the single events. The single event dates are added to the recurring event's dates array. @@ -237,7 +224,7 @@ Booking slots: } ~~~ -**Rule 5:** Modifying a single instance of an recurring event. +**Rule 5. Modifying a single instance of an recurring event.** If a single instance of a recurring event is edited (e.g., time change for a specific date), generate a new slot with the updated time and date in the dates array, overriding the days array. @@ -286,7 +273,7 @@ Booking slot: } ~~~ -**Rule 6:** Deleting a single instance of a recurring event +**Rule 6. Deleting a single instance of a recurring event.** When a single occurrence is removed from a recurring event in Scheduler, we need to update Booking rules to reflect this removal. This is done by creating a special rule for the removed date, using an empty time interval and the dates property (which has higher priority than days). @@ -329,7 +316,7 @@ Booking slot: } ~~~ -**Rule 7:** Events starting later than Booking start date +**Rule 7. Events starting later than Booking start date.** If a recurring event starts after the Booking start date (default is today), create rules with empty time intervals for the dates prior to the event's start date. This simulates the dates being "removed" from the recurrence. @@ -360,16 +347,10 @@ Booking slots: } ~~~ -**Step 3. Timezone Conversion** - -Ensure that the timestamps are converted from global time to the local time of the user's timezone before sending them to Booking. This ensures correct slot display in the Booking widget. -## Example -The snippet below demonstrates how to convert doctor schedules into booking slots. The doctors' schedules that include recurring and single-time events are fetched from the Scheduler widget via the `/doctors/worktime` URL, while the final booking slots generated from the scheduler data are provided by the `/units` URL. The slots are generated on the server-side. Please, also refer to [backend](https://github.com/DHTMLX/scheduler-booking-go). - From 30ca2b74450783c7cbf72e19ae924e9adb155d63 Mon Sep 17 00:00:00 2001 From: tbshag2 Date: Wed, 19 Mar 2025 17:02:20 +0300 Subject: [PATCH 04/13] [update] integration with scheduler updated --- docs/guides/integration-with-widgets.md | 34 ++++++++++++------------- docs/news/whats_new.md | 2 +- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/docs/guides/integration-with-widgets.md b/docs/guides/integration-with-widgets.md index 337276c..834d2c2 100644 --- a/docs/guides/integration-with-widgets.md +++ b/docs/guides/integration-with-widgets.md @@ -16,7 +16,7 @@ The integration primarily focuses on converting the Scheduler data into Booking - Scheduler handles events (e.g., single or recurring). - Booking generates available time slots from those events. -So what you actually need is to generate booking slots from the schedule (the [snippet below](#example) shows how to generate booking slots from the doctor's schedule using JSON data). +So what you actually need is to generate booking slots from the schedule (the [snippet below](#example) shows how to generate booking slots from the doctor's schedule by converting JSON data on server-side). - **Recurring events limitation:** - Booking supports only weekly recurring events (defined as INTERVAL=1;FREQ=WEEKLY in Scheduler). @@ -42,14 +42,12 @@ The snippet below demonstrates how to integrate Booking with the Scheduler widge Converting Scheduler events to Booking slots is the major part of integration and the rules for handling the events and converting them to slots are described in the [section below](#rules-for-converting-scheduler-events-to-booking-slots). -We also ensure that the timestamps are converted correctly. When global (UTC) timestamps are used, they need to be converted to local time before loading them into the system (**l2g** function in the example). Similarly, before saving the data back, the timestamps should be converted from local time to global (UTC) time (**g2l** function in the example). - ## Rules for converting Scheduler events to Booking slots -We will show how to generate booking slots from the doctor's schedule using JSON data. +We will show how to generate booking slots from the doctor's schedule using JSON data. Data is converted on the server-side. The schedule for the next period is considered: from 2025-03-13 to 2027-03-13 **Rule 1. Single event slot creation.** @@ -86,7 +84,7 @@ Booking slot: **Rule 2. Recurring events.** -For recurring events, we use a weekly pattern. The start and end dates must be the same for each occurrence, as Booking only supports weekly recurring slots. +For recurring events, we use a weekly pattern. The start date and end date of each recurring event in Scheduler should be equal to Booking [start](/api/config/booking-start) and [end](/api/config/booking-end) dates, otherwise create placeholders for dates before and after the recurring event (see Rule 7). Scheduler event (weekly on weekdays): the recurrence rule (rrule) specifies that the event repeats weekly on Monday, Tuesday, Wednesday, Thursday, and Friday. @@ -94,13 +92,13 @@ Scheduler event (weekly on weekdays): the recurrence rule (rrule) specifies that { "doctor_id": 1, "start_date": "2025-03-13 09:00:00", - "end_date": "9999-02-01 00:00:00", + "end_date": "2027-03-13 00:00:00", "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "duration": 28800 } ~~~ -Booking Slots: In Booking, the weekly schedule is represented as a single rule, with the same start and end times for all repeated events: +Booking slots: In Booking, the weekly schedule is represented as a single rule, with the same start and end times for all recurring events: ~~~json { @@ -129,7 +127,7 @@ Scheduler event: { "doctor_id": 2, "start_date": "2025-03-13 20:00:00", - "end_date": "9999-02-01 00:00:00", + "end_date": "2027-03-13 00:00:00", "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=SA", "duration": 28800 } @@ -163,8 +161,8 @@ In this case, a single event is added to a recurring schedule. The Booking slots Scheduler events: -- Repeating event: Doctor’s availability from 9:00 AM to 5:00 PM on weekdays. -- Single event: Doctor is also available from 2:00 AM to 6:00 AM on March 18th and 19th. +- Recurring event: a doctor’s availability from 9:00 AM to 5:00 PM on weekdays. +- Single event: a doctor is also available from 2:00 AM to 6:00 AM on March 18th and 19th. ~~~json [ @@ -172,7 +170,7 @@ Scheduler events: { "doctor_id": 1, "start_date": "2025-03-13 09:00:00", - "end_date": "9999-02-01 00:00:00", + "end_date": "2027-03-13 00:00:00", "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "duration": 28800 }, @@ -193,9 +191,8 @@ Scheduler events: Booking slots: -- Merging events: The repeating event and single events are combined into one Booking rule. -- If the single event has priority, its specific dates (March 18th and 19th) are added to the repeating event's rule. -- If the single event needs to override the repeating one, it must not be added to the repeating event’s dates. +- Merging events: the recurring event and single events are combined into one Booking rule. +- If a single event has priority, its specific dates (March 18th and 19th) are added to the recurring event's rule. Please, refer to [Defining the slot rules](/guides/configuration/#defining-slot-rules) ~~~json { @@ -235,7 +232,7 @@ Scheduler event: { "doctor_id": 1, "start_date": "2025-03-13 09:00:00", - "end_date": "9999-02-01 00:00:00", + "end_date": "2027-03-13 00:00:00", "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "duration": 28800 }, @@ -284,7 +281,7 @@ Scheduler event: { "doctor_id": 5, "start_date": "2025-03-14 09:00:00", - "end_date": "9999-02-01 00:00:00", + "end_date": "2027-03-13 00:00:00", "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=TH,FR,SA,SU", "duration": 28800 }, @@ -318,7 +315,7 @@ Booking slot: **Rule 7. Events starting later than Booking start date.** -If a recurring event starts after the Booking start date (default is today), create rules with empty time intervals for the dates prior to the event's start date. This simulates the dates being "removed" from the recurrence. +If a recurring event starts after the Booking start date (default is today and in the example it's 2025-03-14), create rules with empty time intervals for the dates prior to the event's start date. This simulates the dates being "removed" from the recurrence. Scheduler event: @@ -326,7 +323,7 @@ Scheduler event: { "id": "ffbe7628-25f4-4cbe-9127-3bc779d6bafa", "start_date": "2025-03-17 09:00:00", - "end_date": "9999-02-01 00:00:00", + "end_date": "2027-03-13 00:00:00", "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=SU,MO,TU,WE,TH,FR,SA", "duration": 28800 } @@ -335,6 +332,7 @@ Scheduler event: Booking slots: ~~~json +// the start date is March 14, 2025 { "slots": [ { "from": "09:00", "to": "17:00", "days": [0, 1, 2, 3, 4, 5, 6] }, diff --git a/docs/news/whats_new.md b/docs/news/whats_new.md index af1092f..7ad72c7 100644 --- a/docs/news/whats_new.md +++ b/docs/news/whats_new.md @@ -14,7 +14,7 @@ Released on March 12, 2025 - Lazy rendering of cards via the [`renderType`](/api/config/booking-rendertype) property - Ability to embed templates via the [`cardTemplate`](/api/config/booking-cardtemplate) and [`infoTemplate`](/api/config/booking-infotemplate) properties -- [Integration with frameworks](/category/backend-and-frameworks-integration/) and [DHTMLX Event Calendar](/guides/integration-with-widgets/#integration-with-dhtmlx-event-calendar) +- [Integration with frameworks](/category/backend-and-frameworks-integration/) and [DHTMLX Event Calendar](https://snippet.dhtmlx.com/c5eu8pdk) ## Version 1.0.1 From 7a2993eb823e323acafb3c4255fe2e9c837c6f0e Mon Sep 17 00:00:00 2001 From: tbshag2 Date: Thu, 20 Mar 2025 10:43:49 +0300 Subject: [PATCH 05/13] [update] integration with scheduler updated --- docs/guides/integration-with-widgets.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/guides/integration-with-widgets.md b/docs/guides/integration-with-widgets.md index 834d2c2..d31b73c 100644 --- a/docs/guides/integration-with-widgets.md +++ b/docs/guides/integration-with-widgets.md @@ -47,7 +47,7 @@ Converting Scheduler events to Booking slots is the major part of integration an ## Rules for converting Scheduler events to Booking slots -We will show how to generate booking slots from the doctor's schedule using JSON data. Data is converted on the server-side. The schedule for the next period is considered: from 2025-03-13 to 2027-03-13 +We will show how to generate booking slots from the doctor's schedule using JSON data. Data is converted on the server-side. In all example below the schedule for the next period is considered: from 2025-03-13 to 2027-03-13 **Rule 1. Single event slot creation.** @@ -315,7 +315,7 @@ Booking slot: **Rule 7. Events starting later than Booking start date.** -If a recurring event starts after the Booking start date (default is today and in the example it's 2025-03-14), create rules with empty time intervals for the dates prior to the event's start date. This simulates the dates being "removed" from the recurrence. +If a recurring event starts after the Booking start date (default is today which is 2025-03-13 in all examples), create rules with empty time intervals for the dates prior to the event's start date. This simulates the dates being "removed" from the recurrence. Scheduler event: @@ -332,7 +332,7 @@ Scheduler event: Booking slots: ~~~json -// the start date is March 14, 2025 +// the start date here is March 14, 2025 { "slots": [ { "from": "09:00", "to": "17:00", "days": [0, 1, 2, 3, 4, 5, 6] }, From 1f833714c3c0e0f6d4867d5783332af9e9dc4a91 Mon Sep 17 00:00:00 2001 From: tbshag2 Date: Thu, 20 Mar 2025 12:48:56 +0300 Subject: [PATCH 06/13] [update] integration with scheduler updated --- docs/guides/integration-with-widgets.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/guides/integration-with-widgets.md b/docs/guides/integration-with-widgets.md index d31b73c..893a153 100644 --- a/docs/guides/integration-with-widgets.md +++ b/docs/guides/integration-with-widgets.md @@ -332,11 +332,12 @@ Scheduler event: Booking slots: ~~~json -// the start date here is March 14, 2025 +// the start date here is March 13, 2025 { "slots": [ { "from": "09:00", "to": "17:00", "days": [0, 1, 2, 3, 4, 5, 6] }, { "from": "00:00", "to": "00:00", "dates": [ + 1741820400000, // March 13, 2025б 1741906800000, // March 14, 2025 1741993200000, // March 15, 2025 1742079600000 // March 16, 2025 From 62b82652af26bab7174f5d5a30c594373851d474 Mon Sep 17 00:00:00 2001 From: tbshag2 Date: Thu, 20 Mar 2025 12:52:49 +0300 Subject: [PATCH 07/13] [update] integration with scheduler updated --- docs/guides/integration-with-widgets.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/guides/integration-with-widgets.md b/docs/guides/integration-with-widgets.md index 893a153..8f58da0 100644 --- a/docs/guides/integration-with-widgets.md +++ b/docs/guides/integration-with-widgets.md @@ -332,7 +332,6 @@ Scheduler event: Booking slots: ~~~json -// the start date here is March 13, 2025 { "slots": [ { "from": "09:00", "to": "17:00", "days": [0, 1, 2, 3, 4, 5, 6] }, From e8ab015099438b8fd7ad0713c35e4dc8f7a9ca91 Mon Sep 17 00:00:00 2001 From: tbshag2 Date: Thu, 20 Mar 2025 13:08:57 +0300 Subject: [PATCH 08/13] [update] integration with scheduler updated --- docs/guides/integration-with-widgets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/integration-with-widgets.md b/docs/guides/integration-with-widgets.md index 8f58da0..652f645 100644 --- a/docs/guides/integration-with-widgets.md +++ b/docs/guides/integration-with-widgets.md @@ -336,7 +336,7 @@ Booking slots: "slots": [ { "from": "09:00", "to": "17:00", "days": [0, 1, 2, 3, 4, 5, 6] }, { "from": "00:00", "to": "00:00", "dates": [ - 1741820400000, // March 13, 2025б + 1741820400000, // March 13, 2025 1741906800000, // March 14, 2025 1741993200000, // March 15, 2025 1742079600000 // March 16, 2025 From 500e5c9afeb8e767496760b54fcda8715c8e2c7a Mon Sep 17 00:00:00 2001 From: tbshag2 Date: Thu, 20 Mar 2025 16:15:30 +0300 Subject: [PATCH 09/13] [update] integration with scheduler updated --- docs/guides/integration-with-widgets.md | 40 +++++++++++++++---------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/docs/guides/integration-with-widgets.md b/docs/guides/integration-with-widgets.md index 652f645..eff7c90 100644 --- a/docs/guides/integration-with-widgets.md +++ b/docs/guides/integration-with-widgets.md @@ -133,7 +133,7 @@ Scheduler event: } ~~~ -Booking slot: +Booking slots: ~~~json { @@ -246,7 +246,7 @@ Scheduler event: ] ~~~ -Booking slot: +Booking slots: ~~~json { @@ -274,7 +274,7 @@ Booking slot: When a single occurrence is removed from a recurring event in Scheduler, we need to update Booking rules to reflect this removal. This is done by creating a special rule for the removed date, using an empty time interval and the dates property (which has higher priority than days). -Scheduler event: +Scheduler events: ~~~json [ @@ -296,20 +296,27 @@ Scheduler event: ] ~~~ -Booking slot: +Booking slots: ~~~json { - "from": "09:00", - "to": "17:00", - "days": [4, 5, 6, 0] // Thursday to Sunday -}, -{ - "from": "00:00", - "to": "00:00", - "dates": [ - 1742688000000 // 2025-03-23 00:00:00 (deleted occurrence) - ] + "id": 5, + "slotSize":60, + "slotGap":10, + "slots":[ + { + "from": "09:00", + "to": "17:00", + "days": [4, 5, 6, 0] // Thursday to Sunday + }, + { + "from": "00:00", + "to": "00:00", + "dates": [ + 1742688000000 // 2025-03-23 00:00:00 (deleted occurrence) + ] + } + ] } ~~~ @@ -321,7 +328,7 @@ Scheduler event: ~~~json { - "id": "ffbe7628-25f4-4cbe-9127-3bc779d6bafa", + "doctor_id": 5, "start_date": "2025-03-17 09:00:00", "end_date": "2027-03-13 00:00:00", "rrule": "INTERVAL=1;FREQ=WEEKLY;BYDAY=SU,MO,TU,WE,TH,FR,SA", @@ -333,6 +340,9 @@ Booking slots: ~~~json { + "id": 5, + "slotSize":60, + "slotGap":10, "slots": [ { "from": "09:00", "to": "17:00", "days": [0, 1, 2, 3, 4, 5, 6] }, { "from": "00:00", "to": "00:00", "dates": [ From 72c825ee735c09ca4e7354829acc9515f0b95a02 Mon Sep 17 00:00:00 2001 From: tbshag2 Date: Thu, 20 Mar 2025 18:51:57 +0300 Subject: [PATCH 10/13] [update] integration with event calendar added --- docs/guides/integration-with-eventcalendar.md | 381 ++++++++++++++++++ ...dgets.md => integration-with-scheduler.md} | 4 +- docs/news/whats_new.md | 2 +- sidebars.js | 18 +- 4 files changed, 400 insertions(+), 5 deletions(-) create mode 100644 docs/guides/integration-with-eventcalendar.md rename docs/guides/{integration-with-widgets.md => integration-with-scheduler.md} (99%) diff --git a/docs/guides/integration-with-eventcalendar.md b/docs/guides/integration-with-eventcalendar.md new file mode 100644 index 0000000..95f2f4d --- /dev/null +++ b/docs/guides/integration-with-eventcalendar.md @@ -0,0 +1,381 @@ +--- +sidebar_label: Integration with Event Calendar +title: Integration with DHTMLX Event Calendar +description: You can learn about the integration with DHTMLX Event Calendar 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. +--- + +# Integration with DHTMLX Event Calendar + +This guide will show how to integrate the DHTMLX Booking widget with [DHTMLX Event Calendar](https://docs.dhtmlx.com/eventcalendar/). + +## Main concepts + +The integration primarily focuses on converting the Event Calendar data into Booking slots. + +- **Event Calendar events vs. Booking slots:** + - Event Calendar handles events (e.g., single or recurring). + - Booking generates available time slots from those events. + +So what you actually need is to generate booking slots from events (the [snippet below](#example) shows how to generate booking slots from the doctor's schedule by converting JSON data on server-side). + +- **Recurring events limitation:** + - Booking supports only weekly recurring events (defined as INTERVAL=1;FREQ=WEEKLY in Event Calendar). + - Event Calendar can handle any recurring pattern so you will need to hide other recurring options from Event calendar form + +- **Timezone handling:** + - Booking interprets timestamps in the local timezone. + - If you use global timestamps, you need to convert them to local timezones before sending them to Booking (and vice versa before saving the data back). +For conversion instructions, refer to [Working with UTC data](/guides/configuration/saving-reservations/#working-with-utc-data). + +- **Booking slot strategies:** + - Use `slots` and `usedSlots` to build the schedule, ensuring that used slots are excluded (we'll focus on this strategy) + - Use only `availableSlots`, which is suitable for events without recurrences. + +## Example + +The snippet below demonstrates how to integrate Booking with the Event Calendar widget by converting doctors' schedules into booking slots. Key data endpoints used for integration: + +- `/events` - Event Calendar data (doctor schedules) that includes recurring and single-time events. These events are used to create time slots for the Booking system. + +- `/units` - final Booking slots generated from the Event Calendar `events` data. The slots are generated on the server-side. Please, also refer to [backend](https://git.webix.io/XBS/event-calendar-booking-go). + +- `/calendars` - contains doctors' calendars. It is used for displaying doctor information in both the Event Calendar and Booking widgets. + +- `/reservations` - an auxiliary collection used to visualize `usedSlots` in the timeline view. This data comes from the Booking form, containing information about already reserved slots for doctors. + +Converting events to Booking slots is the major part of integration and the rules for handling the events and converting them to slots are described in the [section below](#rules-for-converting-events-to-booking-slots). + + + + +## Rules for converting events to Booking slots + +We will show how to generate booking slots from the doctor's schedule/calendars using JSON data. Data is converted on the server-side. In all example below the schedule for the next period is considered: from 2025-03-13 to 2027-03-13. + +**Rule 1. Single event slot creation.** + +For each single event in the schedule, convert the start and end times to Booking slots by creating an entry in the slots array, including the corresponding date (dates). + +Event Calendar event: + +~~~json +{ + "type": 1, // type is calendar id + "start_date": "2025-03-18T02:00:00Z", // assume dates in UTC + "end_date": "2025-03-18T06:00:00Z" +} +~~~ + +Booking slot: + +~~~json +{ + "id": 1, + "slotSize": 20, + "slotGap": 5, + "slots": [ + { + "from": "02:00", + "to": "06:00", + "dates": [ + 1742256000000 // 2025-03-18 00:00:00 (timestamp) + ] + } + ] +} +~~~ + +**Rule 2. Recurring events.** + +For recurring events, we use a weekly pattern. The start date and end date of each recurring event in Event Calendar should be equal to Booking [start](/api/config/booking-start) and [end](/api/config/booking-end) dates, otherwise create placeholders for dates before and after the recurring event (see Rule 7). + +Event Calendar event (weekly on weekdays): the recurrence rule (rrule) specifies that the event repeats weekly on Monday, Tuesday, Wednesday, Thursday, and Friday. + +~~~json +{ + "type": 1, + "start_date": "2025-03-13T09:00:00Z", + "end_date": "2025-03-13T17:00:00Z", + "recurring": true, + "RRULE": "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR;UNTIL=2027-03-13T23:59:59", + "STDATE": "2025-03-13T09:00:00Z", + "DTEND": "2027-03-13T00:00:00Z" +} +~~~ + +Booking slots: In Booking, the weekly schedule is represented as a single rule, with the same start and end times for all recurring events: + +~~~json +{ + "id": 1, + "slotSize": 20, + "slotGap": 5, + "slots": [ + { + "from": "09:00", + "to": "17:00", + "days": [1, 2, 3, 4, 5] // Monday to Friday + } + ] +} +~~~ + +**Rule 3. Scheduling an event that spans multiple days.** + +If an event spans across multiple days (e.g., starts at 8 PM and ends at 4 AM), it should be split into two slots — one for each day. + +For example, when a doctor's shift starts on Saturday evening and lasts into Sunday morning, Booking can only generate slots within one day. In this case, we need to split the event into two separate rules: one for Saturday and another for Sunday. + +Event Calendar event: + +~~~json +{ + "type": 2, + "start_date": "2025-03-13T20:00:00Z", + "end_date": "2025-03-14T04:00:00Z", + "recurring": true, + "RRULE": "FREQ=WEEKLY;INTERVAL=1;BYDAY=SA;UNTIL=2027-03-13T23:59:59", + "STDATE": "2025-03-13T20:00:00", + "DTEND": "2027-03-13T00:00:00" +} +~~~ + +Booking slots: + +~~~json +{ + "id": 2, + "slotSize": 45, + "slotGap": 5, + "slots": [ + { + "from": "20:00", + "to": "24:10", + "days": [6] // Saturday + }, + { + "from": "00:10", + "to": "04:00", + "days": [0] // Sunday + } + ] +} +~~~ + +**Rule 4. Additional single events added to recurring events.** + +In this case, a single event is added to a recurring schedule. The Booking slots are generated for both the recurring and the single events. The single event dates are added to the recurring event's dates array. + +Event Calendar events: + +- Recurring event: a doctor’s availability from 9:00 AM to 5:00 PM on weekdays. +- Single event: a doctor is also available from 2:00 AM to 6:00 AM on March 18th and 19th. + +~~~json +[ + // recurring event + { + "type": 1, + "start_date": "2025-03-13T09:00:00Z", + "end_date": "2025-03-13T17:00:00Z", + "recurring": true, + "RRULE": "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR;UNTIL=2027-03-13T23:59:59", + "STDATE": "2025-03-13T09:00:00Z", + "DTEND": "2027-03-13T00:00:00Z" + }, + // single events + { + "type": 1, + "start_date": "2025-03-18T02:00:00Z", + "end_date": "2025-03-18T06:00:00Z" + }, + { + "type": 1, + "start_date": "2025-03-19T02:00:00Z", + "end_date": "2025-03-19T06:00:00Z" + } +] +~~~ + +Booking slots: + +- Merging events: the recurring event and single events are combined into one Booking rule. +- If a single event has priority, its specific dates (March 18th and 19th) are added to the recurring event's rule. Please, refer to [Defining the slot rules](/guides/configuration/#defining-slot-rules) + +~~~json +{ + "id": 1, + "slotSize": 20, + "slotGap": 20, + "slots": [ + { + "from": "02:00", + "to": "06:00", + "dates": [ + 1742256000000, // 2025-03-18 00:00:00 + 1742342400000 // 2025-03-19 00:00:00 + ] + }, + { + "from": "09:00", + "to": "17:00", + "days": [1, 2, 3, 4, 5], + "dates": [ + 1742256000000, // 2025-03-18 00:00:00 + 1742342400000 // 2025-03-19 00:00:00 + ] + } + ] +} +~~~ + +**Rule 5. Modifying a single instance of an recurring event.** + +If a single instance of a recurring event is edited (e.g., time change for a specific date), generate a new slot with the updated time and date in the dates array, overriding the days array. + +Event Calendar event: + +~~~json +[ + { + "type": 1, + "start_date": "2025-03-13T09:00:00Z", + "end_date": "2025-03-13T17:00:00Z", + "recurring": true, + "RRULE": "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR;UNTIL=2027-03-13T23:59:59", + "STDATE": "2025-03-13T09:00:00Z", + "DTEND": "2027-03-13T00:00:00Z" + }, + { + "type": 1, + "start_date": "2025-03-14T03:00:00Z", + "end_date": "2025-03-14T11:00:00Z", + "recurring": false, + "recurringEventId": 1, + "originalStartTime": "2025-03-14T09:00:00Z" + }, +] +~~~ + +Booking slots: + +~~~json +{ + "id": 1, + "slotSize": 20, + "slotGap": 5, + "slots": [ + { + "from": "09:00", + "to": "17:00", + "days": [1, 2, 3, 4, 5] + }, + { + "from": "03:00", + "to": "11:00", + "dates": [ + 1741910400000 // 2025-03-14 03:00:00 (modified) + ] + } + ] +} +~~~ + +**Rule 6. Deleting a single instance of a recurring event.** + +When a single occurrence is removed from a recurring event in Event Calendar, we need to update Booking rules to reflect this removal. This is done by creating a special rule for the removed date, using an empty time interval and the dates property (which has higher priority than days). + +Event Calendar events: + +~~~json +[ + { + "type": 5, + "start_date": "2025-03-14T09:00:00Z", + "end_date": "2025-03-14T17:00:00Z", + "recurring": true, + "RRULE": "FREQ=WEEKLY;INTERVAL=1;BYDAY=TH,FR,SA,SU;UNTIL=2027-03-13T23:59:59", + "STDATE": "2025-03-14T09:00:00Z", + "DTEND": "2027-03-13T00:00:00Z" + }, + { + "type": 5, + "recurring": false, + "recurringEventId": 15, + "originalStartTime": "2025-03-23T09:00:00Z", + "status": "cancelled" + } +] +~~~ + +Booking slots: + +~~~json +{ + "id": 5, + "slotSize":60, + "slotGap":10, + "slots":[ + { + "from": "09:00", + "to": "17:00", + "days": [4, 5, 6, 0] // Thursday to Sunday + }, + { + "from": "00:00", + "to": "00:00", + "dates": [ + 1742688000000 // 2025-03-23 00:00:00 (deleted occurrence) + ] + } + ] +} +~~~ + +**Rule 7. Events starting later than Booking start date.** + +If a recurring event starts after the Booking start date (default is today which is 2025-03-13 in all examples), create rules with empty time intervals for the dates prior to the event's start date. This simulates the dates being "removed" from the recurrence. + +Event Calendar event: + +~~~json +{ + "type": 5, + "start_date": "2025-03-17T09:00:00Z", + "end_date": "2025-03-17T17:00:00Z", + "recurring": true, + "RRULE": "FREQ=WEEKLY;INTERVAL=1;BYDAY=SU,MO,TU,WE,TH,FR,SA;UNTIL=2027-03-13T23:59:59", + "STDATE": "2025-03-17T09:00:00Z", + "DTEND": "2027-03-13T00:00:00Z" +} + +~~~ + +Booking slots: + +~~~json +{ + "id": 5, + "slotSize":60, + "slotGap":10, + "slots": [ + { "from": "09:00", "to": "17:00", "days": [0, 1, 2, 3, 4, 5, 6] }, + { "from": "00:00", "to": "00:00", "dates": [ + 1741820400000, // March 13, 2025 + 1741906800000, // March 14, 2025 + 1741993200000, // March 15, 2025 + 1742079600000 // March 16, 2025 + ]} + ] +} +~~~ + + + + + + + + + + diff --git a/docs/guides/integration-with-widgets.md b/docs/guides/integration-with-scheduler.md similarity index 99% rename from docs/guides/integration-with-widgets.md rename to docs/guides/integration-with-scheduler.md index eff7c90..f1a54c1 100644 --- a/docs/guides/integration-with-widgets.md +++ b/docs/guides/integration-with-scheduler.md @@ -1,12 +1,12 @@ --- -sidebar_label: Integration with DHTMLX Scheduler +sidebar_label: Integration with Scheduler title: Integration with DHTMLX Scheduler description: You can learn about the integration with DHTMLX Scheduler 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. --- # Integration with DHTMLX Scheduler -This guide will show how to integrate the DHTMLX Booking widget with DHTMLX Scheduler. +This guide will show how to integrate the DHTMLX Booking widget with [DHTMLX Scheduler](https://docs.dhtmlx.com/scheduler/). ## Main concepts diff --git a/docs/news/whats_new.md b/docs/news/whats_new.md index 7ad72c7..d87df3e 100644 --- a/docs/news/whats_new.md +++ b/docs/news/whats_new.md @@ -14,7 +14,7 @@ Released on March 12, 2025 - Lazy rendering of cards via the [`renderType`](/api/config/booking-rendertype) property - Ability to embed templates via the [`cardTemplate`](/api/config/booking-cardtemplate) and [`infoTemplate`](/api/config/booking-infotemplate) properties -- [Integration with frameworks](/category/backend-and-frameworks-integration/) and [DHTMLX Event Calendar](https://snippet.dhtmlx.com/c5eu8pdk) +- [Integration with frameworks](/category/backend-and-frameworks-integration/) and [DHTMLX Event Calendar](/guides/integration-with-eventcalendar) ## Version 1.0.1 diff --git a/sidebars.js b/sidebars.js index de60bd4..bd23b49 100644 --- a/sidebars.js +++ b/sidebars.js @@ -144,8 +144,22 @@ module.exports = { "guides/integration-with-react", "guides/integration-with-vue", "guides/integration-with-svelte", - "guides/integration-with-widgets", - ] + + + { + type: "category", + label: "Integration with DHTMLX widgets", + collapsible: true, + collapsed: true, + link: { + type: 'generated-index', + title: "Integration with DHTMLX widgets" + }, + items: [ + "guides/integration-with-eventcalendar", + "guides/integration-with-scheduler", + ] + },] }, // end Backend and frameworks integration { From 3730f29fda72cd46f4ed2a5ca0d22a7478a2c7f7 Mon Sep 17 00:00:00 2001 From: tbshag2 Date: Thu, 20 Mar 2025 19:07:26 +0300 Subject: [PATCH 11/13] [update] integration with event calendar updated --- docs/guides/integration-with-eventcalendar.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/integration-with-eventcalendar.md b/docs/guides/integration-with-eventcalendar.md index 95f2f4d..9e9ff89 100644 --- a/docs/guides/integration-with-eventcalendar.md +++ b/docs/guides/integration-with-eventcalendar.md @@ -135,8 +135,8 @@ Event Calendar event: "end_date": "2025-03-14T04:00:00Z", "recurring": true, "RRULE": "FREQ=WEEKLY;INTERVAL=1;BYDAY=SA;UNTIL=2027-03-13T23:59:59", - "STDATE": "2025-03-13T20:00:00", - "DTEND": "2027-03-13T00:00:00" + "STDATE": "2025-03-13T20:00:00Z", + "DTEND": "2027-03-13T00:00:00Z" } ~~~ From d5578386dfce664ec3bf26e562895ff7ad95b3ea Mon Sep 17 00:00:00 2001 From: tbshag2 Date: Thu, 20 Mar 2025 19:49:48 +0300 Subject: [PATCH 12/13] [update] integration with event widgets updated --- docs/guides/integration-with-eventcalendar.md | 2 +- docs/guides/integration-with-scheduler.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/integration-with-eventcalendar.md b/docs/guides/integration-with-eventcalendar.md index 9e9ff89..31aa8c7 100644 --- a/docs/guides/integration-with-eventcalendar.md +++ b/docs/guides/integration-with-eventcalendar.md @@ -229,7 +229,7 @@ Booking slots: } ~~~ -**Rule 5. Modifying a single instance of an recurring event.** +**Rule 5. Modifying a single instance of a recurring event.** If a single instance of a recurring event is edited (e.g., time change for a specific date), generate a new slot with the updated time and date in the dates array, overriding the days array. diff --git a/docs/guides/integration-with-scheduler.md b/docs/guides/integration-with-scheduler.md index f1a54c1..4f864f5 100644 --- a/docs/guides/integration-with-scheduler.md +++ b/docs/guides/integration-with-scheduler.md @@ -221,7 +221,7 @@ Booking slots: } ~~~ -**Rule 5. Modifying a single instance of an recurring event.** +**Rule 5. Modifying a single instance of a recurring event.** If a single instance of a recurring event is edited (e.g., time change for a specific date), generate a new slot with the updated time and date in the dates array, overriding the days array. From fa3687023c0fd62eafbd1d80dad8b6486eb7c38e Mon Sep 17 00:00:00 2001 From: tbshag2 Date: Fri, 21 Mar 2025 10:42:39 +0300 Subject: [PATCH 13/13] [update] integration with event widgets updated --- docs/guides/integration-with-eventcalendar.md | 2 +- docs/guides/integration-with-scheduler.md | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/guides/integration-with-eventcalendar.md b/docs/guides/integration-with-eventcalendar.md index 31aa8c7..0de5080 100644 --- a/docs/guides/integration-with-eventcalendar.md +++ b/docs/guides/integration-with-eventcalendar.md @@ -50,7 +50,7 @@ Converting events to Booking slots is the major part of integration and the rule ## Rules for converting events to Booking slots -We will show how to generate booking slots from the doctor's schedule/calendars using JSON data. Data is converted on the server-side. In all example below the schedule for the next period is considered: from 2025-03-13 to 2027-03-13. +We will show how to generate booking slots from the doctor's schedule/calendars using JSON data. Data is converted on the the server-side. In all example below the schedule for the next period is considered: from 2025-03-13 to 2027-03-13. **Rule 1. Single event slot creation.** diff --git a/docs/guides/integration-with-scheduler.md b/docs/guides/integration-with-scheduler.md index 4f864f5..cd38830 100644 --- a/docs/guides/integration-with-scheduler.md +++ b/docs/guides/integration-with-scheduler.md @@ -16,7 +16,7 @@ The integration primarily focuses on converting the Scheduler data into Booking - Scheduler handles events (e.g., single or recurring). - Booking generates available time slots from those events. -So what you actually need is to generate booking slots from the schedule (the [snippet below](#example) shows how to generate booking slots from the doctor's schedule by converting JSON data on server-side). +So what you actually need is to generate booking slots from the schedule (the [snippet below](#example) shows how to generate booking slots from the doctor's schedule by converting JSON data on the server-side). - **Recurring events limitation:** - Booking supports only weekly recurring events (defined as INTERVAL=1;FREQ=WEEKLY in Scheduler). @@ -42,12 +42,11 @@ The snippet below demonstrates how to integrate Booking with the Scheduler widge Converting Scheduler events to Booking slots is the major part of integration and the rules for handling the events and converting them to slots are described in the [section below](#rules-for-converting-scheduler-events-to-booking-slots). - ## Rules for converting Scheduler events to Booking slots -We will show how to generate booking slots from the doctor's schedule using JSON data. Data is converted on the server-side. In all example below the schedule for the next period is considered: from 2025-03-13 to 2027-03-13 +We will show how to generate booking slots from the doctor's schedule using JSON data. Data is converted on the server-side. In all example below the schedule for the next period is considered: from 2025-03-13 to 2027-03-13. **Rule 1. Single event slot creation.**