Ioannis Posted November 8, 2020 Report Share Posted November 8, 2020 In Caspio's template "Appointment Scheduler" there is a calendar (https://apps.caspio.com/demo18/asr/admin/schedule-patients.html) with a "new appointment" button. Is there any idea how could I create a similar button in a calendar? Quote Link to comment Share on other sites More sharing options...
0 Alison Posted November 9, 2020 Report Share Posted November 9, 2020 Hi @Ioannis, You may request this application to be uploaded into your account and check the code how it was created. Also, you may follow this article for anothere approach:https://howto.caspio.com/tech-tips-and-articles/common-customizations/how-to-create-date-specific-new-record-links-in-calendar-datapages/ Quote Link to comment Share on other sites More sharing options...
0 Ioannis Posted November 21, 2020 Author Report Share Posted November 21, 2020 Hi Alison Thanks for your reply Caspio has uploaded the app into my account. In the calendar form the "add new" button is missing even with the following code in the footer: <script> document.addEventListener('DataPageReady', function (event) { // Set links for navigation bar $('a[data-cb-name="JumpToFirst"] > img').attr('src', '[@app:URL_2]'); $('a[data-cb-name="JumpToPrev"] > img').attr('src', '[@app:URL_5]'); $('a[data-cb-name="JumpToNext"] > img').attr('src', '[@app:URL_4]'); $('a[data-cb-name="JumpToLast"] > img').attr('src', '[@app:URL_3]'); // Add link to New Appointment page var month = ""; var allSpanTags = document.getElementsByTagName("li"); for (i = 0; i < allSpanTags.length; i++) { if (allSpanTags[i].className == "cbResultSetCalendarCaption") { month = allSpanTags[i].innerText; } } month = month.replace(/January /gi, "1/Day/"); month = month.replace(/February /gi, "2/Day/"); month = month.replace(/March /gi, "3/Day/"); month = month.replace(/April /gi, "4/Day/"); month = month.replace(/May /gi, "5/Day/"); month = month.replace(/June /gi, "6/Day/"); month = month.replace(/July /gi, "7/Day/"); month = month.replace(/August /gi, "8/Day/"); month = month.replace(/September /gi, "9/Day/"); month = month.replace(/October /gi, "10/Day/"); month = month.replace(/November /gi, "11/Day/"); month = month.replace(/December /gi, "12/Day/"); var allHTMLTags = new Array(); // Create Array of All HTML Tags var allHTMLTags = document.getElementsByTagName("div"); // Loop through all tags using a for loop for (i = 0; i < allHTMLTags.length; i++) { // Get all tags with the specified class name. if (allHTMLTags[i].className == "cbResultSetCalendarField") { var transfer = month.replace(/Day/gi, allHTMLTags[i].innerHTML); // Check if date is not past date var sysDate = '[@cbTimestamp*]'; var dateToday = new Date(sysDate); var dateCalendar = new Date(transfer); if (dateCalendar >= dateToday) { // Begin Add New Link Section allHTMLTags[i].innerHTML = '<a class="truncated float-left" title="New Appointment" style="text-decoration:none;" href="./new-appointment.html?Date=' + transfer + '"><i class="fa fa-calendar-plus fa-lg"></i></a>' + allHTMLTags[i].innerHTML; // End of Add New Link Section } } } }); </script> I have also tried the directions of the article and I pasted the following code into the footer of calendar form: <script> document.addEventListener('DataPageReady', function(event) { var month = ""; var allSpanTags = document.getElementsByTagName("span"); for (i=0; i<allSpanTags.length; i++) { if (allSpanTags[i].className == "cbResultSetCalendarCaption"){ month = allSpanTags[i].innerHTML; } } month = month.replace(/January /gi,"1/Day/"); month = month.replace(/February /gi,"2/Day/"); month = month.replace(/March /gi,"3/Day/"); month = month.replace(/April /gi,"4/Day/"); month = month.replace(/May /gi,"5/Day/"); month = month.replace(/June /gi,"6/Day/"); month = month.replace(/July /gi,"7/Day/"); month = month.replace(/August /gi,"8/Day/"); month = month.replace(/September /gi,"9/Day/"); month = month.replace(/October /gi,"10/Day/"); month = month.replace(/November /gi,"11/Day/"); month = month.replace(/December /gi,"12/Day/"); var allHTMLTags = new Array(); //Create Array of All HTML Tags var allHTMLTags = document.getElementsByTagName("div"); //Loop through all tags using a for loop for (i=0; i<allHTMLTags.length; i++) { //Get all tags with the specified class name. if (allHTMLTags[i].className == "cbResultSetCalendarField") { var transfer = month.replace(/Day/gi,allHTMLTags[i].innerHTML); /*Begin Add New Link Section*/ allHTMLTags[i].innerHTML = allHTMLTags[i].innerHTML +'<br><a style="text-decoration:none;" href="https://www.breastmedicare.eu/test.html?Date='+transfer+'">Add New</a>'; /*End of Add New Link Section*/ } } }); </script> where https://www.breastmedicare.eu/test.html is the URL of the submission form. The "add new" button is there but it doesn't transfer the date to the submission form! Is there something I have done wrong? Quote Link to comment Share on other sites More sharing options...
0 Kurumi Posted May 7, 2022 Report Share Posted May 7, 2022 Hi everyone - Just wanted to share this solution. If you want to save the date in your Calendar or download it as a .ics file. You may use an external JS library called Add-to-Calendar Button:https://jekuer.github.io/add-to-calendar-button/https://github.com/jekuer/add-to-calendar-button Quote Link to comment Share on other sites More sharing options...
0 Kurumi Posted September 23, 2022 Report Share Posted September 23, 2022 Hi - Good news! Caspio has a new Tech tip called Downloading Appointments to Calendars Using ICS Files. To know more on how to implement it in the DataPage, you can check it here: https://howto.caspio.com/tech-tips-and-articles/advanced-customizations/download-appointments-to-calendars-using-ics-files/ Quote Link to comment Share on other sites More sharing options...
0 PotatoMato Posted December 16, 2023 Report Share Posted December 16, 2023 Hi! Just to add, Caspio has also an article that enables you to download Calendar events as PDF: https://howto.caspio.com/tech-tips-and-articles/downloading-calendar-events-as-pdf-files/ -Potato Quote Link to comment Share on other sites More sharing options...
Question
Ioannis
In Caspio's template "Appointment Scheduler" there is a calendar (https://apps.caspio.com/demo18/asr/admin/schedule-patients.html) with a "new appointment" button. Is there any idea how could I create a similar button in a calendar?
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.