<commit_before>var TimeSlider = function(initialTime, initialDate, map) {
  var sliderValue = (initialTime.getHours() * 60) +
      (Math.floor(initialTime.getMinutes() / 15) * 15);

  function computeTime(value) {
    // yuck - cleanup
    var val = value / 60;
    var hour = Math.floor(val);
    var min = (val - hour) * 60;
    if (hour > 12) {
      hour = hour - 12;
    }
    hour = (hour < 10) ? "0" + hour : "" + hour;
    min = (min < 10) ? "0" + min : "" + min;
    return [hour, min];
  }

  function displayTime(value) {
    var time = computeTime(value);
    $("#sliderTime").empty().append(time.join(":"));
  }

  displayTime(sliderValue);
  $("#slider").slider({
    min: 0,  max: 1440, value : sliderValue, step: 15,
    slide : function(event, ui) {
      displayTime(ui.value);
    },
    change: function(event, ui) {
      var time = computeTime(ui.value);
      map.clear();
      map.loadTrucksForTime(initialDate + "-" + time.join(""));
    }
  });
};

var TruckMap = function(lat, lng) {
  var latlng = new google.maps.LatLng(lat, lng);
  var trucks = [];
  var self = this;
  var map = new google.maps.Map(document.getElementById("map_canvas"), {
    zoom: 14,
    center: latlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  });

  self.clear = function () {
    $.each(trucks, function(idx, truck) {
      truck.removeMarker();
    });
    trucks = [];
  };

  self.loadTrucksForTime = function(requestTime) {
    $.ajax({<commit_msg>Fixed bug where PM times were reverting to AM times.<commit_after>var TimeSlider = function(initialTime, initialDate, map) {
  var sliderValue = (initialTime.getHours() * 60) +
      (Math.floor(initialTime.getMinutes() / 15) * 15);

  function computeTime(value, twelveHour) {
    // yuck - cleanup
    var val = value / 60;
    var hour = Math.floor(val);
    var min = (val - hour) * 60;
    if (hour > 12 && twelveHour) {
      hour = hour - 12;
    }
    hour = (hour < 10) ? "0" + hour : "" + hour;
    min = (min < 10) ? "0" + min : "" + min;
    return [hour, min];
  }

  function displayTime(value) {
    var time = computeTime(value, true);
    $("#sliderTime").empty().append(time.join(":"));
  }

  displayTime(sliderValue);
  $("#slider").slider({
    min: 0,  max: 1440, value : sliderValue, step: 15,
    slide : function(event, ui) {
      displayTime(ui.value);
    },
    change: function(event, ui) {
      var time = computeTime(ui.value, false);
      map.clear();
      map.loadTrucksForTime(initialDate + "-" + time.join(""));
    }
  });
};

var TruckMap = function(lat, lng) {
  var latlng = new google.maps.LatLng(lat, lng);
  var trucks = [];
  var self = this;
  var map = new google.maps.Map(document.getElementById("map_canvas"), {
    zoom: 14,
    center: latlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  });

  self.clear = function () {
    $.each(trucks, function(idx, truck) {
      truck.removeMarker();
    });
    trucks = [];
  };

  self.loadTrucksForTime = function(requestTime) {
    $.ajax({
{'fraction_non_alphanumeric': 0.1709913506320692, 'fraction_numerical': 0.01929474384564205, 'mean_word_length': 2.7967171717171717, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 5, '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': '5083333', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1044, 'n_words': 236}