<commit_before>
$(document).ready ->

  window.calendar = $("#calendar").fullCalendar
    theme: false
    minTime: config.minTime || '0'
    maxTime: config.maxTime || '24'
    slotMinutes: config.slotMinutes
    allDaySlot: false
    defaultView: 'agendaDay'
    allDay: false
    slotEventOverlap: false

    header: 
      left: 'prev,next today'
      center: 'title'
      right: 'month,agendaWeek,agendaDay'

    selectable: true
    selectHelper: true
    editable: true
    unselectAuto: false
    
    events: (start, end, callback) ->
      $.ajax
        url: config.appointments_url
        dataType: 'json'
        success: (doc)->
          events = []
          allAppointments = doc.appointments
          slots = allAppointments.filter (item)->
                    item if item.time_slot
          appointments = allAppointments.filter (item)->
                    item if ! item.time_slot

          #for slot in slots
          i=0
          while i < slots.length # length changes while going through the loop
            slot = slots[i]
            i++
            for appointment in appointments
              if appointment.start >= slot.start && appointment.end <= slot.end
                first = jQuery.extend({}, slot)
                second = jQuery.extend({}, slot)
                first.start = slot.start <commit_msg>fix display my appointments for a patient<commit_after>
$(document).ready ->

  window.calendar = $("#calendar").fullCalendar
    theme: false
    minTime: config.minTime || '0'
    maxTime: config.maxTime || '24'
    slotMinutes: config.slotMinutes
    allDaySlot: false
    defaultView: 'agendaDay'
    allDay: false
    slotEventOverlap: false

    header: 
      left: 'prev,next today'
      center: 'title'
      right: 'month,agendaWeek,agendaDay'

    selectable: true
    selectHelper: true
    editable: true
    unselectAuto: false
    
    events: (start, end, callback) ->
      $.ajax
        url: config.appointments_url
        dataType: 'json'
        success: (doc)->
          events = []
          allAppointments = doc.appointments
          slots = allAppointments.filter (item)->
                    item if item.time_slot
          appointments = allAppointments.filter (item)->
                    item if ! item.time_slot

          #for slot in slots
          i=0
          while i < slots.length # length changes while going through the loop
            slot = slots[i]
            i++
            for appointment in appointments
              if appointment.start >= slot.start && appointment.end <= slot.end
                continue if appointment.customer_id.toString() == config.customerID.toString() 
                first = jQuery.extend({}, slot)
                second = jQuery.extend({}, slot)
                first.start = slot.start 
{'fraction_non_alphanumeric': 0.09709425939050319, 'fraction_numerical': 0.002834868887313962, 'mean_word_length': 1.9013360739979446, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '1786774', 'n_tokens_mistral': 773, 'n_tokens_neox': 747, 'n_words': 208}