Skip to content

Commit

Permalink
fix(filters): ensure dates are parsed
Browse files Browse the repository at this point in the history
This commit fixes a bug in the filter parser library such that it
converts dates for the client into new Date() objects.
  • Loading branch information
Jonathan Niles committed Feb 15, 2017
1 parent 32b6297 commit 5ad15ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/lib/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class FilterParser {

if (this._filters[filterKey]) {
let preparedStatement = `DATE(${tableString}${columnAlias}) >= DATE(?)`;
this._addFilter(preparedStatement, this._filters[filterKey]);
this._addFilter(preparedStatement, new Date(this._filters[filterKey]));

delete this._filters[filterKey];
}
Expand All @@ -104,7 +104,7 @@ class FilterParser {
if (this._filters[filterKey]) {
let preparedStatement = `DATE(${tableString}${columnAlias}) <= DATE(?)`;

this._addFilter(preparedStatement, this._filters[filterKey]);
this._addFilter(preparedStatement, new Date(this._filters[filterKey]));
delete this._filters[filterKey];
}
}
Expand Down

0 comments on commit 5ad15ec

Please sign in to comment.