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 authored and jniles committed Feb 14, 2017
1 parent 5a7dc10 commit eae6d7a
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 eae6d7a

Please sign in to comment.