[chronojump-server] Fixing filters in results



commit 6febcafa57aa7ef272bb9b45e511f1c12405bf84
Author: Marcos Venteo <mventeo gmail com>
Date:   Sun May 28 21:43:21 2017 +0200

    Fixing filters in results

 chronojump-flask/templates/results.html |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/chronojump-flask/templates/results.html b/chronojump-flask/templates/results.html
index d26c404..b03ef8e 100644
--- a/chronojump-flask/templates/results.html
+++ b/chronojump-flask/templates/results.html
@@ -36,7 +36,7 @@ $.fn.dataTableExt.oSort["customdate-asc"] = function (x, y) {
                                var date = Date.parse(data[1]); // use data for the age column
                                var d = new Date();
                                if (filter != "all") {
-                                       d.setDate(d.getDate() - filter);
+                                       d.setDate(d.getDate() - filter -1);
                                        if ( date >= d )
                {
                    return true;
@@ -186,7 +186,7 @@ $.fn.dataTableExt.oSort["customdate-asc"] = function (x, y) {
 
                                        var column = this;
                                        var idx = column.index();
-                                       if (idx == 2) {
+                                       if (idx == 3) {
                                                var select = $('<select class="form-control"><option 
value="">Tots els jugadors</option></select>')
                                                        .appendTo($('#filterByPlayer'))
                                                        .on('change', function() {
@@ -207,7 +207,7 @@ $.fn.dataTableExt.oSort["customdate-asc"] = function (x, y) {
                                                column.data().unique().sort().each(function(d, j) {
                                                        select.append('<option value="' + d + '">' + d + 
'</option>')
                                                });
-                                       } else if (idx == 3) {
+                                       } else if (idx == 4) {
                                                var select = $('<select class="form-control"><option 
value="">Totes les estacions</option></select>')
                                                        .appendTo($('#filterByStation'))
                                                        .on('change', function() {
@@ -224,7 +224,7 @@ $.fn.dataTableExt.oSort["customdate-asc"] = function (x, y) {
                                                column.data().unique().sort().each(function(d, j) {
                                                        select.append('<option value="' + d + '">' + d + 
'</option>')
                                                });
-                                       } else if (idx == 4) {
+                                       } else if (idx == 5) {
                                                var select = $('<select class="form-control"><option 
value="">Tots els exercicis</option></select>')
                                                        .appendTo($('#filterByExercice'))
                                                        .on('change', function() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]