Appointment DatetimePicker

Developer
Size
4,301 Kb
Views
14,168

How do I make an appointment datetimepicker?

What is a appointment datetimepicker? How do you make a appointment datetimepicker? This script and codes were developed by JasonPark on 19 December 2022, Monday.

Appointment DatetimePicker Previews

Appointment DatetimePicker - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Appointment DatetimePicker</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <link href="https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i" rel="stylesheet"> </head> <body> <div class="y-appointment-wrapper"> <div class="appointment-notification"></div> <form action=""> <fieldset class="field-set-reset"> <legend class="title">Pick a day and time</legend> <div class="date-pick" data-selected-id=-1> <div class="scroll-btn left"> <span class="scroll-img-wrap"> <svg "20px" height="30px"> <path fill="#ccc" d="M16.1,32l3.9-3.9L7.9,16L20,3.9L16.1,0L0,16L16.1,32z M17.1,3.9L5, 16l12.1,12.1l-1.1,1.1L2.9,16L16.1,2.9L17.1,3.9z" /> </svg> </span> </div> <div class="date-wrapper"> <div class="date-scroll-container"> <!--<label for="" class="timecell"> <input type="radio"> <span class="fill-box"></span> <span class="time-day">Mon</span> <span class="time-date">1</span> <span class="time-month">May.</span> <span class="time-available">5 available</span> </label>--> </div> </div> <div class="scroll-btn right"> <span class="scroll-img-wrap"> <svg width="20px" height="30px"> <path fill="#ccc" d="M3.9,0L0,3.9L12.1,16L0,28.1L3.9,32L20,16L3.9,0z M2.9,28.1L15, 16L2.9,3.9l1.1-1.1L17.1,16L3.9,29.1L2.9,28.1z"></path> </svg> </span> </div> </div> <div class="time-pick" data-ts-selected-id=-1> <section> <div class="time-slot morning"> <h3 class="slot-heading">morning</h3> <div class="slot"> <label class="time-slice" for="" option-id="0"> <input type="radio"> <span>11:20a</span> </label> <label class="time-slice" for="" option-id="1"> <input type="radio"> <span>11:40a</span> </label> </div> </div> <div class="time-slot afternoon"> <h3 class="slot-heading">afternoon</h3> <div class="slot"> <label class="time-slice" for="" option-id="2"> <input type="radio"> <span>12:40p</span> </label> <label class="time-slice" for="" option-id="3"> <input type="radio"> <span>4:00p</span> </label> <label class="time-slice" for="" option-id="4"> <input type="radio"> <span>4:20p</span> </label> <label class="time-slice" for="" option-id="5"> <input type="radio"> <span>4:40p</span> </label> </div> </div> <div class="time-slot evening"> <h3 class="slot-heading">evening</h3> <div class="slot"> <label class="time-slice" for="" option-id="6"> <input type="radio"> <span>6:00p</span> </label> </div> </div> </section> </div> </fieldset> </form> </div> </body>
</html> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Appointment DatetimePicker - Script Codes CSS Codes

html, body { margin: 0; padding: 0; width:100%; height:100%;
}
body { font-family:'Roboto', sans-serif; font-size:13px; font-weight:300;
}
h1,h2,h3,h4{ margin: 0; padding: 0;
}
.y-appointment-wrapper { padding-left:10%; padding-right: 10%;
}
.field-set-reset{ padding: 0; border: 0; margin: 0; min-width: 0;
}
fieldset legend.title { text-align:center; font-size:36px; margin-bottom:50px;
}
.scroll-btn { width:3%; height:140px; display:inline-block; position:relative; cursor:pointer;
}
.scroll-btn.left{ margin-right:2%;
}
.scroll-btn.right{ margin-left:2%;
}
.scroll-img-wrap { position:absolute; top:50%; transform:translateY(-50%);
}
.date-pick { width:100%; height:150px; margin-bottom:80px;
}
.date-pick .date-wrapper { width:88%; display:inline-block; height:150px; vertical-align:top; text-align:center; margin-left: 0; margin-right: 0;
}
.date-pick .date-scroll-container { white-space:nowrap; overflow-x:scroll; height:150px;
}
.date-pick .date-scroll-container::-webkit-scrollbar { display:none;
}
.date-wrapper input[type="radio"] { box-sizing: border-box; padding:0; border: 0; overflow: hidden; position: absolute; width: 1px; height: 1px;
}
.date-wrapper .timecell { position: relative; width:20%; display:inline-block; box-sizing:border-box; height:140px; cursor:pointer;
}
.date-wrapper .date-item{ display:block; border:1px solid #eee; padding:20px 0;
}
/*.timecell .fill-box { border:1px solid #eee; z-index:-1; position: absolute; width: 100%; height: 100%; top: 0; right: 0; bottom: 0; left: 0;
}*/
.timecell.selected .date-item{ border-color:#e6b6a4; z-index:1;
}
.timecell .time-day,
.timecell .time-date,
.timecell .time-month,
.timecell .time-available { display:block;
}
.time-day { font-size:15px; line-height: 22px;
}
.time-date { color:black; font-size:40px; line-height: 48px;
}
.selected .time-date{ color:#e3b6a4;
}
.time-month { font-size:15px; line-height: 22px; color:#aaa;
}
.time-pick .time-slot {
}
.time-pick .time-slot.morning,
.time-pick .time-slot.afternoon,
.time-pick .time-slot.evening{ text-transform: uppercase; float:left; text-align:center; box-sizing: border-box;
}
.time-pick .time-slot .slot-heading { border-bottom:1px solid #ccc; border-top: 1px solid #ccc; box-sizing:border-box; padding-top: 15px; padding-bottom: 15px; background-color:#f7f7f7; font-weight:300;
}
.time-pick .time-slot.morning .slot-heading{ border-left:1px solid #ccc;
}
.time-pick .time-slot.evening .slot-heading{ border-right:1px solid #ccc;
}
.time-pick .time-slot.morning,
.time-pick .time-slot.evening{ width:25%;
}
.time-pick .time-slot.afternoon{ width:50%;
}
.time-slot .slot input[type="radio"]{ box-sizing: border-box; padding: 0; border: 0; overflow: hidden; position: absolute; width: 1px; height: 1px;
}
.time-slot .time-slice{ display:inline-block; width:100%; padding-top: 15px; padding-bottom: 15px; box-sizing: border-box; border:1px solid #ccc; font-size:15px; font-weight:300; margin-top:4px; margin-bottom: 4px; cursor:pointer;
}
.time-slice.selected{ border:1px solid #e3b6a4; color:#e3b6a4;
}
.time-slot.afternoon .time-slice{ width:calc(50% - 8px);
}
@media all and (min-width : 300px) and (max-width : 768px){ .y-appointment-wrapper{ padding-left: 5%; padding-right: 5%; } legend.title { font-size:20px; } .date-pick .date-wrapper{ width:100%; } .date-wrapper .timecell { width:33%; } .scroll-btn { display:none; } .time-slot { width:100% !important; margin-bottom:15px; } .time-slot .slot-heading{ border:1px solid #ccc; } .time-slot .time-slice{ width:100% !important; }
}

Appointment DatetimePicker - Script Codes JS Codes

(function(doc, win, $, undefined){ 'use strict'; dataInit(); scrollEventBinder($); timeCellClickEvent($); timeSliceClickEvent($); function dataInit(){ var datetimes = [ // { // "day":0, // "date":0, // "month":"May", // "available":10 // } ]; var scContainer = doc.querySelectorAll('.date-scroll-container')[0]; var days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] for(var i = 0 ; i < 30 ; i++){ var item = { "day":days[i%7], "date":i+1, "month":"May", "available":"10 available" } scContainer.appendChild(getTemplate(interpolate(i, item))); } } function interpolate(idx, dItem){ return `<label option-id=${idx} class="timecell">\ <span class="date-item"> <input type="radio">\ <span class="fill-box"></span>\ <span class="time-day">${dItem.day}</span>\ <span class="time-date">${dItem.date}</span>\ <span class="time-month">${dItem.month}</span>\ <span class="time-available">${dItem.available}</span>\ </span> </label>`; } function getTemplate(html){ var template = doc.createElement('template'); template.innerHTML = html; return template.content.firstChild; } function scrollEventBinder($){ var dsc = $('.date-scroll-container')[0]; $('.scroll-btn.left').on('click', function(){ dsc.scrollLeft -= dsc.clientWidth; }); $('.scroll-btn.right').on('click', function(){ dsc.scrollLeft += dsc.clientWidth; }); } function timeCellClickEvent($){ var $dp = $('.date-pick'); $('.timecell').click(function(){ var sidx = +$dp.attr('data-selected-id'); if(sidx !== -1){ $('.timecell[option-id="'+sidx+'"]').removeClass("selected"); } $dp.attr('data-selected-id', $(this).attr("option-id")); $(this).addClass('selected'); }); } function timeSliceClickEvent($){ var $tp = $('.time-pick'); $('.time-slice').click(function(){ var tsidx = +$tp.attr('data-ts-selected-id'); if(tsidx !== -1){ $('.time-slice[option-id="'+tsidx+'"]').removeClass("selected"); } $tp.attr('data-ts-selected-id', $(this).attr("option-id")); $(this).addClass('selected'); }); }
})(document, window, $);
Appointment DatetimePicker - Script Codes
Appointment DatetimePicker - Script Codes
Home Page Home
Developer JasonPark
Username wooljs
Uploaded December 19, 2022
Rating 3
Size 4,301 Kb
Views 14,168
Do you need developer help for Appointment DatetimePicker?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

JasonPark (wooljs) Script Codes
Create amazing SEO content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!