{"id":2165,"date":"2019-10-03T10:09:18","date_gmt":"2019-10-03T10:09:18","guid":{"rendered":"https:\/\/mindfusion.eu\/blog\/?p=2165"},"modified":"2021-01-23T16:15:36","modified_gmt":"2021-01-23T16:15:36","slug":"appointment-scheduler-in-javascript","status":"publish","type":"post","link":"https:\/\/mindfusion.dev\/blog\/appointment-scheduler-in-javascript\/","title":{"rendered":"Appointment Scheduler in JavaScript"},"content":{"rendered":"<p>In this blog post we will build from scratch an appointment schedule for 4 practitioners. Each appointment is logged with the patient name and contact details. Each appointment can be scheduled in one of 4 rooms. We will also implement a check to see if the room that we want to assign to an appointment is free at the particular time.<\/p>\n<p>You can run the sample online from the link below:<\/p>\n<p><a title=\"Appointment Scheduler in JavaScript\" href=\"https:\/\/mindfusion.dev\/javascript-demo.html?sample=AppointmentSchedule\"><img decoding=\"async\" src=\"https:\/\/mindfusion.dev\/product_images\/javascript\/library\/scheduler\/appointment_schedule.png\" \/><\/a><\/p>\n<p><strong>I. Project Setup<\/strong><\/p>\n<p>The first thing we&#8217;ll do is to create a DIV element and assign it an id. The JS Schedule library needs and HTML div element where the timetable will be rendered. We create one:<\/p>\n<pre id=\"line1\">&lt;<span class=\"start-tag\">div<\/span> <span class=\"attribute-name\">id<\/span>=\"<a class=\"attribute-value\">calendar<\/a>\" <span class=\"attribute-name\">style<\/span>=\"<a class=\"attribute-value\">height: 100%;width: 100%<\/a>\"&gt;&lt;\/<span class=\"end-tag\">div<\/span>&gt;<\/pre>\n<p>You can position the div element wherever you wish. It&#8217;s location and size determine the location and the size of the schedule.<\/p>\n<p>Next, we need to reference the Schedule library file. It is called MindFusion.Scheduling. We reference it at the end of the web page, right after the closing BODY tag:<\/p>\n<pre id=\"line1\">&lt;<span class=\"start-tag\">script<\/span> <span class=\"attribute-name\">src<\/span>=\"<a class=\"attribute-value\" href=\"view-source:https:\/\/mindfusion.dev\/blog\/appointment-scheduler-in-javascript\/scripts\/MindFusion.Scheduling.js\">scripts\/MindFusion.Scheduling.js<\/a>\" <span class=\"attribute-name\">type<\/span>=\"<a class=\"attribute-value\">text\/javascript<\/a>\"&gt;&lt;\/<span class=\"end-tag\">script<\/span>&gt;\n<span id=\"line330\"><\/span>&lt;<span class=\"start-tag\">script<\/span> <span class=\"attribute-name\">src<\/span>=\"<a class=\"attribute-value\" href=\"view-source:https:\/\/mindfusion.dev\/blog\/appointment-scheduler-in-javascript\/AppointmentSchedule.js\">AppointmentSchedule.js<\/a>\" <span class=\"attribute-name\">type<\/span>=\"<a class=\"attribute-value\">text\/javascript<\/a>\"&gt;&lt;\/<span class=\"end-tag\">script<\/span>&gt;<\/pre>\n<p>We will write the JavaScript code for the appointment schedule in a separate JS file, which we call AppointmentSchedule. We have added a reference to it as well.<\/p>\n<p><strong>II. Schedule Settings<\/strong><\/p>\n<p>In the JavaScript code behind file we first create a mapping to the MindFusion.Scheduling namespace and a reference to the Intellisense file:<\/p>\n<pre>\/\/\/ \n\nvar p = MindFusion.Scheduling;<\/pre>\n<p>Next, we use the id of the DIV element to create an instance of the <a title=\"Charting for JavaScript API Reference: Calendar\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_Calendar_0.htm\">Calendar<\/a> class:<\/p>\n<pre>\/\/ create a new instance of the calendar\ncalendar = new p.Calendar(document.getElementById(\"calendar\"));<\/pre>\n<p>We set the <a title=\"Charting for JavaScript API Reference: currentView\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Calendar_currentView_0.htm\">currentView<\/a> property of the calendar to <a title=\"Charting for JavaScript API Reference: CalendarView\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_CalendarView_0.htm\">CalendarView<\/a> Timetable:<\/p>\n<pre>\/\/ set the view to Timetable, which displays the allotment \n\/\/ of resources to distinct hours of a day\ncalendar.currentView = p.CalendarView.Timetable;<\/pre>\n<p>We use the <a title=\"Charting for JavaScript API Reference: timetableSettings\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Calendar_timetableSettings_0.htm\">timetableSettings<\/a> property to specify the time range for each day. The starttime and <a title=\"Charting for JavaScript API Reference: endTime\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_TimetableSettings_endTime_0.htm\">endTime<\/a> properties set exactly the begin and end of the time interval rendered by the timetable columns. They are measured in minutes, from midnight of the day they refer to. We want the schedule to start from 7 A that is why we set 420 as value to the <a title=\"Charting for JavaScript API Reference: startTime\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_TimetableSettings_startTime_0.htm\">startTime<\/a> property &#8211; the minutes in 7 hours.<\/p>\n<pre>calendar.timetableSettings.startTime = 420;\ncalendar.timetableSettings.endTime = 1260;<\/pre>\n<p>The <a title=\"Charting for JavaScript API Reference: titleFormat\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_TimetableSettings_titleFormat_0.htm\">titleFormat<\/a> property specifies how the date at each timetable column will be rendered. The format string follows the standard date and time pattern for JavaScript:<\/p>\n<pre>calendar.timetableSettings.titleFormat = \"dddd d MMM yyyy\";\ncalendar.itemSettings.tooltipFormat = \"%s[hh:mm tt] - %e[hh:mm tt] %h (Contact: %d)\";<\/pre>\n<p>The <a title=\"Charting for JavaScript API Reference: tooltipFormat\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_ItemSettings_tooltipFormat_0.htm\">tooltipFormat<\/a> follows a custom formatting pattern, used by Js Scheduler. It supports special format strings like:<\/p>\n<ul>\n<li>%s for start time<\/li>\n<li>%e for end time<\/li>\n<li>%h for header e.g. the text of the item header<\/li>\n<li>%d for description: the text that was assigned as a description of the appointment.<\/li>\n<\/ul>\n<p><strong>III. Contacts, Locations and Grouping<\/strong><\/p>\n<p>The 4 practitioners are instances of the <a title=\"Charting for JavaScript API Reference: Contact\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_Contact_Members_1.htm\">Contact<\/a> class:<\/p>\n<pre>resource = new p.Contact();\nresource.firstName = \"Dr. Lora\";\nresource.lastName = \"Patterson\";\nresource.tag = 2;\ncalendar.schedule.contacts.add(resource);<\/pre>\n<p>It is important to add them to the <a title=\"Charting for JavaScript API Reference: contacts\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Schedule_contacts_0_1.htm\">contacts<\/a> property of the schedule. The rooms where the appointments take place are <a title=\"Charting for JavaScript API Reference: Location\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_Location_Members_1.htm\">Location<\/a> instances:<\/p>\n<pre>resource.name = \"Room 112\";\ncalendar.schedule.locations.add(resource);<\/pre>\n<p>The grouping of the data that is rendered by the timetable is done is a method called group:<\/p>\n<pre>function group(value) {\n\tcalendar.contacts.clear();\n\tif (value == p.GroupType.GroupByContacts) {\n\t\t\/\/ add the contacts by which to group to the calendar.contacts collection\n\t\tcalendar.contacts.addRange(calendar.schedule.contacts.items());\n\t}\n\tcalendar.locations.clear();\n\tif (value == p.GroupType.GroupByLocations) {\n\t\t\/\/ add the locations by which to group to the calendar.locations collection\n\t\tcalendar.locations.addRange(calendar.schedule.locations.items());\n\t}\n\tcalendar.groupType = value;\n}<\/pre>\n<p>When we&#8217;ve created the locations and contacts, we added them to the <a title=\"Charting for JavaScript API Reference: locations\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Calendar_locations_0.htm\">locations<\/a> and <a title=\"Charting for JavaScript API Reference: contacts\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Calendar_contacts_0.htm\">contacts<\/a> collections of the <a title=\"Charting for JavaScript API Reference: schedule\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Calendar_schedule_0.htm\">schedule<\/a> property of the <a title=\"Charting for JavaScript API Reference: Calendar\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_Calendar_0.htm\">Calendar<\/a> . Grouping of the appointments is done based on the <a title=\"Charting for JavaScript API Reference: contacts\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Calendar_contacts_0.htm\">contacts<\/a> and <a title=\"Charting for JavaScript API Reference: locations\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Calendar_locations_0.htm\">locations<\/a> collections of the <a title=\"Charting for JavaScript API Reference: Calendar\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_Calendar_Members_0.htm\">Calendar<\/a> (not the <a title=\"Charting for JavaScript API Reference: schedule\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Calendar_schedule_0.htm\">schedule<\/a> ). That is why in the group method we clear the data from the respective collection and add to it all data from the corresponding collection in the <a title=\"Charting for JavaScript API Reference: schedule\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Calendar_schedule_0.htm\">schedule<\/a> Of course, we must set the <a title=\"Charting for JavaScript API Reference: groupType\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Calendar_groupType_0.htm\">groupType<\/a> property to the appropriate <a title=\"Charting for JavaScript API Reference: GroupType\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_GroupType.htm\">GroupType<\/a> value.<\/p>\n<p><strong>IV. Appointments<\/strong><\/p>\n<p>When the user selects a range of cells the new Appointment dialog appears automatically. There they can enter all necessary data. We want to implement check if a given room is free when the user tries to create a new appointment in this room. We will do the check in the handler of the <a title=\"Charting for JavaScript API Reference: itemCreating\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?E_MindFusion_Scheduling_Calendar_itemCreating.htm\">itemCreating<\/a> event. The <a title=\"Charting for JavaScript API Reference: itemCreating\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?E_MindFusion_Scheduling_Calendar_itemCreating.htm\">itemCreating<\/a> event is raised when the new item has not been ready yet and the <a title=\"Charting for JavaScript API Reference: ItemModifyingEventArgs\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_ItemModifyingEventArgs.htm\">ItemModifyingEventArgs<\/a> object that is provided to the event handler gives the opportunity to cancel the event:<\/p>\n<pre>calendar.itemCreating.addEventListener(handleItemCreating);\n\nfunction handleItemCreating(sender, args)\n{\n\tvar appLocation = args.item.location;\n\t\n\tif(appLocation != null )\n\t{\n\t\tif(appLocation.name != \"\")\n\t\t{\n\t\t\tvar items = calendar.schedule.items.items();\n\t\t\tfor(var i = 0; i &lt; calendar.schedule.items.count(); i++)\n\t\t\t{\n\t\t\t\tif( items[i].location == null)\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t\/\/if the location is the same as the location of another appointment\n\t\t\t\t\/\/at that time we cancel the creating of the appointment\n\t\t\t\tif( items[i].location.name == appLocation.name &amp;&amp; \n\t\t\t\toverlappingAppointments (args.item, items[i]))\n\t\t\t\t{\n\t\t\t\t\targs.cancel = true;\n\t\t\t\t\talert(\"The room is already taken\");\n\t\t\t\t}\n\t\n\t\t\t}\n\t\t}\n\t}\n}<\/pre>\n<p>We use a helper method called overlappingAppointments, whose only task is to compare the time range of two items and return true if their time span overlaps &#8211; entirely or partially.<\/p>\n<pre>\/* checks if the time allotted to two different appointments overlaps *\/\nfunction overlappingAppointments(item1, item2)\n{\n\tif( item1.startTime &lt; item2.startTime &amp;&amp;\n\t    item1.endTime &lt; item2.endTime )\n\t\t  return false;\n\t\t  \n\tif( item1.startTime &gt; item2.endTime &amp;&amp;\n\t    item1.endTime &gt; item2.endTime )\n\t\t  return false;\t\n\t\t  \n\t\t  return true;\t  \t\t\n}<\/pre>\n<p><strong>V. Timeline<\/strong><\/p>\n<p>Our timetable renders one day at a time. When the user wants to add an appointment that is due in 10 days, they will need to do a lot of scrolling. We can solve the problem by adding a date list at the top o the timetable. The list is another <a title=\"Charting for JavaScript API Reference: Calendar\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?The_Calendar.htm\">Calendar<\/a> instance and but its <a title=\"Charting for JavaScript API Reference: currentView\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Calendar_currentView_0.htm\">currentView<\/a> is set to <a title=\"Charting for JavaScript API Reference: CalendarView\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_CalendarView_0.htm\">CalendarView<\/a> List.<\/p>\n<p>We first need to add another DIV element that will be used by the constructor of the new <a title=\"Charting for JavaScript API Reference: Calendar\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_Calendar_Members_0.htm\">Calendar<\/a>:<\/p>\n<div id=\"datePicker\" style=\"height: 25px; display: inline-block; margin-bottom: 10px;\"><\/div>\n<p>Then we create new <a title=\"Charting for JavaScript API Reference: Calendar\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_Calendar_0.htm\">Calendar<\/a> object and make it render a list with dates:<\/p>\n<pre>datePicker = new p.Calendar(document.getElementById(\"datePicker\"));\ndatePicker.currentView = p.CalendarView.List;<\/pre>\n<p>By default each <a title=\"Charting for JavaScript API Reference: Calendar\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_Calendar_0.htm\">Calendar<\/a> renders the current date when it starts. We make it display a succession of 30 days. We want each day to have a prefix that indicates its week day. In addition, we hide the header of the calendar and stop the default &#8220;New Appointment&#8221; form from rendering when the user clicks on a cell:<\/p>\n<pre>datePicker.listSettings.visibleCells = datePicker.listSettings.numberOfCells = 30;\ndatePicker.listSettings.headerStyle = p.MainHeaderStyle.None;\ndatePicker.listSettings.generalFormat = \"ddd d\";\ndatePicker.useForms = false;<\/pre>\n<p>How do we &#8220;wire&#8221; the selected date in the timeline to the active date in the timetable? We handle the <a title=\"Charting for JavaScript API Reference: selectionEnd\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?E_MindFusion_Scheduling_Calendar_selectionEnd.htm\">selectionEnd<\/a> event and there we assign the selected date from the timeline as the active date of the timetable:<\/p>\n<pre>function handleSelectionEnd(sender, args) {\n\tvar startDate = args.startTime;\n\tvar endDate = args.endTime;\n\n\t\/\/ show the selected date range in the timetable\n\tcalendar.timetableSettings.dates.clear();\n\twhile (startDate &lt; endDate) {\n\t\tcalendar.timetableSettings.dates.add(startDate);\n\t\tstartDate = p.DateTime.addDays(startDate, 1);\n\t}\n}<\/pre>\n<p>A timetable renders those dates, that are added to its <a title=\"Charting for JavaScript API Reference: dates\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_TimetableSettings_dates_0.htm\">dates<\/a> property. We add just one date &#8211; the date that was selected in the list.<\/p>\n<p>Let\u2019s not forget to call the <a title=\"Charting for JavaScript API Reference: render\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?M_MindFusion_Scheduling_Calendar_render_0.htm\">render<\/a> method once we&#8217;ve finished all customizations on both <a title=\"Charting for JavaScript API Reference: Calendar\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_Calendar_0.htm\">Calendar<\/a> render the calendar control<\/p>\n<pre>calendar.render();\n\/\/render the timeline control\ndatePicker.render();<\/pre>\n<p><strong>VI. Styling<\/strong><\/p>\n<p>The general styling of the two <a title=\"Charting for JavaScript API Reference: Calendar\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_Calendar_Members_0.htm\">Calendar<\/a> instances is done with one of the predefined themes of the Js Scheduler library. First, we need to add a reference to the CSS file, where it is defined. We&#8217;ve chosen the &#8220;pastel&#8221; theme, which is defined in pastel.css:<\/p>\n<pre><\/pre>\n<p>Then we need only to set its name as a plain string to the <a title=\"Charting for JavaScript API Reference: theme\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Calendar_theme_0.htm\">theme<\/a> property of the two <a title=\"Charting for JavaScript API Reference: Calendar\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?The_Calendar.htm\">Calendar<\/a> instances:<\/p>\n<pre>calendar.theme = \"pastel\";\ndatePicker.theme = \"pastel\";<\/pre>\n<p>There is one more styling that we want to do: we want the appointments of each practicioner to be colored in a different color. We inspect the styling o the appointment element in the browser and find out that the styling of the items is set by the class mfp-item. We create 4 different sub-classes of mfp-item for the 4 practitioners:<\/p>\n<pre>.itemClass0 .mfp-item\n\t\t{\n\t\t\tbackground-color: #03738C !important;\n\t\t\tcolor: #fff !important;\n\t\t}\n\t\t.itemClass1 .mfp-item\n\t\t{\n\t\t\tbackground-color: #03A6A6 !important;\n\t\t\tcolor: #fff !important;\n\t\t}\n..............<\/pre>\n<p>Then we need to assign the correct class to the appointments. We will do this with the <a title=\"Charting for JavaScript API Reference: cssClass\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Item_cssClass_0.htm\">cssClass<\/a> property of <a title=\"Charting for JavaScript API Reference: Item\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_Item_Members_1.htm\">Item<\/a> We handle the <a title=\"Charting for JavaScript API Reference: itemCreated\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?E_MindFusion_Scheduling_Calendar_itemCreated.htm\">itemCreated<\/a> event where we get information for the appointment that was created:<\/p>\n<pre>calendar.itemCreated.addEventListener(handleItemCreated);\n\nfunction handleItemCreated(sender, args)\n{\n\tvar contact = args.item.contacts.items()[0];\n\t\n\tif(contact != null )\n\t\targs.item.cssClass = \"itemClass\" + contact.tag;<\/pre>\n<p>}<\/p>\n<p>The easiest way to assign the correct CSS class to the item is to assign data that will help us generate the correct style name. We use the <a title=\"Charting for JavaScript API Reference: tag\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?P_MindFusion_Scheduling_Resource_tag_0_1.htm\">tag<\/a> property of <a title=\"Charting for JavaScript API Reference: Contact\" href=\"https:\/\/www.mindfusion.dev\/onlinehelp\/scheduler.javascript\/index.htm?T_MindFusion_Scheduling_Contact_1.htm\">Contact<\/a> and assign each practitioner an id that mirrors the last letter in the CSS class we should assign to the appointments associated with this contact.<\/p>\n<p>With that our appointment application is finished. You can download the full source code with the libraries and styles used from this link:<\/p>\n<p align=\"center\"><a title=\"JavaScript Appointment Schedule: Download\" href=\"https:\/\/mindfusion.dev\/samples\/javascript\/scheduler\/AppointmentSchedule.zip\">Appointment Schedule in JavaScript: Source Code Download<\/a><\/p>\n<p><em>About MindFusion JavaScript Scheduler:<\/em> MindFusion Js Scheduler is the complete solution for all applications that need to render interactive timetables, event schedules or appointment calendars. Fully responsive, highly customizable and easy to integrate, you can quickly program the JavaScript scheduling library according to your needs. Find out more at <a href=\"https:\/\/mindfusion.dev\/javascript-scheduler.html\">https:\/\/mindfusion.dev\/javascript-scheduler.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog post we will build from scratch an appointment schedule for 4 practitioners. Each appointment is logged with the patient name and contact details. Each appointment can be scheduled in one of 4 rooms. We will also implement &hellip; <a href=\"https:\/\/mindfusion.dev\/blog\/appointment-scheduler-in-javascript\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":2168,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[513,74,104],"tags":[572,568,571,533,573,570,569],"class_list":["post-2165","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","category-sample-code","category-scheduling-2","tag-javascript-appointment-calendar","tag-javascript-code","tag-javascript-scheduler","tag-js-calendar","tag-js-schedule-library","tag-js-timetable","tag-sample-code"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/mindfusion.dev\/blog\/wp-content\/uploads\/2019\/10\/appointment_schedule.png","jetpack_shortlink":"https:\/\/wp.me\/p3RlKs-yV","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/posts\/2165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/comments?post=2165"}],"version-history":[{"count":11,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/posts\/2165\/revisions"}],"predecessor-version":[{"id":2633,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/posts\/2165\/revisions\/2633"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/media\/2168"}],"wp:attachment":[{"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/media?parent=2165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/categories?post=2165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mindfusion.dev\/blog\/wp-json\/wp\/v2\/tags?post=2165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}