<commit_before>﻿@model AutogearWeb.Models.CalendarModel
@{
    ViewBag.Title = "Calendar";
}
@if (Model.IsUserAdmin)
{
    <div class="col-xs-12 col-sm-3 widget-container-col">
        <div class="widget-box widget-color-dark light-border">
            <div class="widget-header">
                <h5 class="widget-title smaller">Search for Instructor</h5>
            </div>

            <div class="widget-body">
                <div class="widget-main padding-6">
                    @Html.DropDownList("InstructorName", Model.InstructorList, new { @class = "chosen-select form-control" , data_placeholder="Choose a Instructor..."})
                </div>
            </div>
        </div>
    </div>
    
    <div class="row">
        <div class="col-lg-12">&nbsp;</div>
    </div>
}
<div id="Calendar"></div>


@section Scripts
{
    @Scripts.Render("~/bundles/bootstrap");
    @Scripts.Render("~/bundles/bootstrappicker");
    @Scripts.Render("~/bundles/chosenjs");
    @Scripts.Render("~/bundles/jqueryUI");
    @Scripts.Render("~/bundles/Fullcalendar")
    <script>
        $(function() {
            $(".chosen-select").chosen();
            var modalDialog = "";
            var studentData = "";
            var baseUrl = "/Api/AutogearApi/";
            var instructor = "";

            function bookingAppointment(bookingId) {
                $.ajax({
                    url: "/Instructor/BookingAppointment",
                    method: "POST",
                    dataType: "html",
                    data: { bookingId: bookingId }

                }).success(function(data) {
                    modalDialog = data;
                });
            }

            $.getJSON(baseUrl + "GetStudentNames").success(function(data) {
                studentData = data;
            });
            bookingAppointment(0);
            var calendar = $("#Calendar").fullCalendar({
                defaultView: "agendaWeek",

                header: {
                    left: "prev,next today",
                    center: "title",
                    right: "month,agendaWeek,agendaDay"
                },

                allDaySlot: false,
                slotDuration: "00:15:01",
                //minTime: "06:00:00",
                //maxTime: "24:00:00",

                defaultDate: "@(new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).ToString("yyyy-MM-dd"))",
                selectable: true,
                selectHelper: true,
                select: function(start, end, allDay) {
                    var modal = $(modalDialog).appendTo("body");
                    var startDate = $.datepicker.formatDate("yy-mm-dd", new Date(start));
                    var view = calendar.fullCalendar("getView");
                    if (view.name === "month")
                        end = end.add("-1", "day");
                    var endDate = $.datepicker.formatDate("yy-mm-dd", new Date(end));
                    modal.find("#StartDate").val(startDate);
                    modal.find("#EndDate").val(endDate);
                    modal.find("#StartTime").val(start.hours() + ":" + start.minutes());
                    modal.find("#StopTime").val(end.hours() + ":" + end.minutes());
                    modal.find("#InstructorName").val($("#InstructorName option:selected").text());
                    //var stDate = new Date(start);
                    //var eDate = new Date(end);

                    modal.find("#StudentName").autocomplete({
                        source: studentData,
                        minLength: 2
                    });
                    modal.find("#submitForm").on("click", function(ev) {
                        ev.preventDefault();
                        var startTime = modal.find("#StartDate").val() + "T" + modal.find("#StartTime").val();
                        var stopTime = modal.find("#EndDate").val() + "T" + modal.find("#StopTime").val();
                        var bookingAppointment = {
                            BookingId: modal.find("#BookingId").val(),<commit_msg>change date format according to datepicker<commit_after>﻿@model AutogearWeb.Models.CalendarModel
@{
    ViewBag.Title = "Calendar";
}
@if (Model.IsUserAdmin)
{
    <div class="col-xs-12 col-sm-3 widget-container-col">
        <div class="widget-box widget-color-dark light-border">
            <div class="widget-header">
                <h5 class="widget-title smaller">Search for Instructor</h5>
            </div>

            <div class="widget-body">
                <div class="widget-main padding-6">
                    @Html.DropDownList("InstructorName", Model.InstructorList, new { @class = "chosen-select form-control" , data_placeholder="Choose a Instructor..."})
                </div>
            </div>
        </div>
    </div>
    
    <div class="row">
        <div class="col-lg-12">&nbsp;</div>
    </div>
}
<div id="Calendar"></div>


@section Scripts
{
    @Scripts.Render("~/bundles/bootstrap");
    @Scripts.Render("~/bundles/bootstrappicker");
    @Scripts.Render("~/bundles/chosenjs");
    @Scripts.Render("~/bundles/jqueryUI");
    @Scripts.Render("~/bundles/Fullcalendar")
    <script>
        $(function() {
            $(".chosen-select").chosen();
            var modalDialog = "";
            var studentData = "";
            var baseUrl = "/Api/AutogearApi/";
            var instructor = "";

            function bookingAppointment(bookingId) {
                $.ajax({
                    url: "/Instructor/BookingAppointment",
                    method: "POST",
                    dataType: "html",
                    data: { bookingId: bookingId }

                }).success(function(data) {
                    modalDialog = data;
                });
            }

            $.getJSON(baseUrl + "GetStudentNames").success(function(data) {
                studentData = data;
            });
            bookingAppointment(0);
            var calendar = $("#Calendar").fullCalendar({
                defaultView: "agendaWeek",

                header: {
                    left: "prev,next today",
                    center: "title",
                    right: "month,agendaWeek,agendaDay"
                },

                allDaySlot: false,
                slotDuration: "00:15:01",
                //minTime: "06:00:00",
                //maxTime: "24:00:00",

                defaultDate: "@(new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).ToString("yyyy-MM-dd"))",
                selectable: true,
                selectHelper: true,
                select: function(start, end, allDay) {
                    var modal = $(modalDialog).appendTo("body");
                    var startDate = $.datepicker.formatDate("dd-mm-yy", new Date(start));
                    var view = calendar.fullCalendar("getView");
                    if (view.name === "month")
                        end = end.add("-1", "day");
                    var endDate = $.datepicker.formatDate("dd-mm-yy", new Date(end));
                    modal.find("#StartTime,#StopTime").timepicker({
                        minuteStep: 1,
                        showSeconds: false,
                        showMeridian: false,
                        disableFocus: true
                    }).on("focus", function () {
                        $(this).timepicker("showWidget");
                    });
                    modal.find("#StartDate,#EndDate").datepicker({
                        minDate: 0,
                        dateFormat: "dd-mm-yy"
                    });
                    modal.find("#StartDate").val(startDate);
                    modal.find("#EndDate").val(endDate);
                    modal.find("#StartTime").val(start.hours() + ":" + start.minutes());
                    modal.find("#StopTime").val(end.hours() + ":" + end.minutes());
                    modal.find("#InstructorName").val($("#InstructorName option:selected").text());
                    //var stDate = new Date(start);
                    //var eDate = new Date(end);

                    modal.find("#StudentName").autocomplete({
                        source: studentData,
                        minLength: 2
                    });
                    modal.find("#submitForm").on("click", function(ev) {
                        ev.preventDefault();
                        var startTime = modal.find("#StartDate").val() + "T" + modal.find("#StartTime").val();
                        var stopTime = modal.find("#EndDate").val() + "T" + modal.find("#StopTime").val();
                        var bookingAppointment = {
                            BookingId: modal.find("#BookingId").val(),
{'fraction_non_alphanumeric': 0.1505711318795431, 'fraction_numerical': 0.007153571016499365, 'mean_word_length': 1.4843794783605617, 'pattern_counts': {'":': 4, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4219327', 'n_tokens_mistral': 2368, 'n_tokens_neox': 2185, 'n_words': 381}