Ignore:
Timestamp:
Jun 10, 2011, 5:22:01 PM (13 years ago)
Author:
dennisw
Message:

Datepicker works. Next, will link it to user/dataset and fix some minor things.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/website/static/heatmap_extensions.js

    r9246 r9251  
    4444//    enc = $('#select_enc option:selected').text();
    4545//    date = $('#select_date option:selected').text();
     46    start_date = $('#start_date').val();
     47    end_date = $('#end_date').val();
    4648    colour = encodeURIComponent(document.getElementById("colour").value);
    4749    lname = encodeURIComponent(document.getElementById("lname").value);
     
    5658//    if (enc != ''){enc='&accespoint__encryptie='+enc;}
    5759//    if (date != ''){date='&meetrondje__datum='+date;}
    58     if (colour != ''){colour='colour='+colour;}
     60    if (start_date && end_date){
     61      sd_d=start_date.substr(0,2);
     62      sd_m=start_date.substr(3,2);
     63      sd_y=start_date.substr(6,4);
     64
     65      ed_d=end_date.substr(0,2);
     66      ed_m=end_date.substr(3,2);
     67      ed_y=end_date.substr(6,4);
     68
     69      start_date='&meetrondje__datum__gte=' + sd_y +'-'+ sd_m +'-'+ sd_d;
     70      end_date='&meetrondje__datum__lte=' + ed_y +'-'+ ed_m +'-'+ ed_d;
     71    }
     72
     73
     74    if (colour != 'NaN,NaN,NaN'){colour='colour='+colour;}
    5975    else {colour = '&colour='+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256);}
    6076    if (lname != ''){lname=lname;}
     
    6682      initialize: function(name, options) {
    6783        var url = [
    68           baseurl + colour + user + dataset + wlnode /* + enc + date */
     84          baseurl + colour + user + dataset + wlnode + start_date + end_date /* + enc */
    6985        ];
    7086        document.getElementById('filter_text').innerHTML+="<br />Added: " + url;
Note: See TracChangeset for help on using the changeset viewer.