Skip to content

Commit

Permalink
code-style improvements, setup for better date filter handling
Browse files Browse the repository at this point in the history
  • Loading branch information
andyperlitch committed Sep 6, 2013
1 parent 139b905 commit b366354
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 2 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var ConfigModel = Backbone.Model.extend({
return "Offset must be greater than 0";
}
if (attrs.max_rows < 1) {
return "max_rows must atleast 1";
return "max_rows must at least be 1";
}
},
getVisibleRows: function() {
Expand Down Expand Up @@ -260,8 +260,6 @@ var Tabled = BaseView.extend({

},



grabTableResizer: function(evt){
evt.preventDefault();
evt.stopPropagation();
Expand Down Expand Up @@ -293,7 +291,7 @@ var Tabled = BaseView.extend({
var abChangeY = Math.abs(changeY);
if ( abChangeY > row_height) {
abChangeY = Math.floor(abChangeY/row_height) * (changeY > 0 ? 1 : -1);
self.config.set({'max_rows':initMax + abChangeY}, {validate:true});
self.config.set({'max_rows':initMax + abChangeY}, { validate: true });
}
}
var cleanup_resize = function(evt) {
Expand Down
10 changes: 6 additions & 4 deletions lib/Filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,19 @@ exports.date = function(term, value) {
var lowerbound = now - parseDateFilter(against_2);
return value >= lowerbound;
}
if ( first_two == ">=" ) {
else if ( first_two == ">=" ) {
var upperbound = now - parseDateFilter(against_2);
return value <= upperbound;
}
if ( first_char == "<" ) {
else if ( first_char == "<" ) {
var lowerbound = now - parseDateFilter(against_1);
return value > lowerbound;
}
if ( first_char == ">" ) {
else if ( first_char == ">" ) {
var upperbound = now - parseDateFilter(against_1);
return value < upperbound;
} else {
// no comparative signs found
return false;
}
return false ;
}

0 comments on commit b366354

Please sign in to comment.