<commit_before>/*
 * HTML representation of the sidebar
 */

function print_time(time) {
  time = new Date(time);
  var hour = time.getUTCHours();
  var am_pm = "";
  if( hour >= 12 ) 
    am_pm = "pm";
  else
    am_pm = "am";

  hour = hour % 12;
  if(hour == 0) {
    hour = 12;
  }

  return hour + ":" + ("0" + time.getUTCMinutes()).slice(-2) + am_pm;
}

function Sidebar( sections  ) { 
  this.sections = sections;
}

Sidebar.prototype.render_section_row = function( section ) {
  var row = $("<div/>");

  for( i in section.meetings ) {
    var meeting = section.meetings[i].table;
    row.append( $("<span/>")
                .addClass("hidden id")
                .text( section.id ) ); 
    row.append( $("<span/>")
                .addClass("section-type label")
                .text( section.short_type ) ); 

    var instructor_name;
    if (meeting.instructors.length >= 1)  {
      instructor_name = meeting.instructors[0].full_name;
    } else {
      instructor_name = "TBD";
    }

    row.append( $("<span/>")
                .addClass("instructor")
                .text( instructor_name ) ); 
    row.append( $("<span/>")
                .addClass("code")
                .text( section.code ) ); 
    row.append( $("<span/>")
                .addClass("enrollment status-" + section.enrollment_status) );
    row.append( $("<span/>")
                .addClass("time")
                .text(print_time(meeting.start_time) + "-" + print_time(meeting.end_time))); 
  }
  return row;
}
<commit_msg>fixed schedule sidebar render bug<commit_after>/*
 * HTML representation of the sidebar
 */

function print_time(time) {
  time = new Date(time);
  var hour = time.getUTCHours();
  var am_pm = "";
  if( hour >= 12 ) 
    am_pm = "pm";
  else
    am_pm = "am";

  hour = hour % 12;
  if(hour == 0) {
    hour = 12;
  }

  return hour + ":" + ("0" + time.getUTCMinutes()).slice(-2) + am_pm;
}

function Sidebar( sections  ) { 
  this.sections = sections;
}

Sidebar.prototype.render_section_row = function( section ) {
  var row = $("<div/>");

  for( i in section.meetings ) {
    var meeting = section.meetings[i].table;
    row.append( $("<span/>")
                .addClass("hidden id")
                .text( section.id ) ); 
    row.append( $("<span/>")
                .addClass("section-type label")
                .text( section.short_type ) ); 

    var instructor_name;
    if (meeting.instructors.length >= 1)  {
      instructor_name = meeting.instructors[0];
    } else {
      instructor_name = "TBD";
    }

    row.append( $("<span/>")
                .addClass("instructor")
                .text( instructor_name ) ); 
    row.append( $("<span/>")
                .addClass("code")
                .text( section.code ) ); 
    row.append( $("<span/>")
                .addClass("enrollment status-" + section.enrollment_status) );
    row.append( $("<span/>")
                .addClass("time")
                .text(print_time(meeting.start_time) + "-" + print_time(meeting.end_time))); 
  }
  return row;
}

{'fraction_non_alphanumeric': 0.16984231274638634, 'fraction_numerical': 0.007227332457293035, 'mean_word_length': 2.069556451612903, 'pattern_counts': {'":': 2, '<': 17, '<?xml version=': 0, '>': 21, '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': '4031493', 'n_tokens_mistral': 1040, 'n_tokens_neox': 978, 'n_words': 200}