Date filters not dynamically updated.

Issue #17 resolved
Paul Stasiuk repo owner created an issue

Date filters and drop downs are not being dynamically updated with the rest of the possible categories. Would also be nice to add the sites box.

Comments (2)

  1. Paul Stasiuk reporter

    Resolved in commit f44a2a2 with the following method:

    //Function that updates the date box with a new date range
    function updateDateDropdowns(dates){
      var date_from = document.getElementById(date_from_scroll_box_id);
      var date_too = document.getElementById(date_too_sctroll_box_id);
    
      while(date_from.hasChildNodes()){
        date_from.removeChild(date_from.lastChild);
      }
    
      while(date_too.hasChildNodes()){
        date_too.removeChild(date_too.lastChild);
      }
    
      for (var i = 0; i<dates.length; i++){
        var option = document.createElement("option");
        option.text= dates[i];
        date_from.add(option,null);
      }for (var i = dates.length-1 ; i>0 ; i--){
        var option = document.createElement("option");
        option.text=dates[i];
        date_to.add(option,null);
      }
    
    }
    
  2. Log in to comment