Skip to content

Commit

Permalink
Merge pull request persvr#28 from kriszyp/master
Browse files Browse the repository at this point in the history
Properly handle dates within queries
  • Loading branch information
kriszyp committed May 8, 2013
2 parents c37d09b + 117a7c9 commit 284c0d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js-array.js
Expand Up @@ -379,6 +379,9 @@ function query(query, options, target){
return "(function(){var filtered = []; for(var i = 0, length = this.length; i < length; i++){var item = this[i];if(" + condition + "){filtered.push(item);}} return filtered;})";
}
}else{
if (value instanceof Date){
return value.valueOf();
}
return "(function(){return op('" + value.name + "').call(this" +
(value && value.args && value.args.length > 0 ? (", " + value.args.map(queryToJS).join(",")) : "") +
")})";
Expand Down

0 comments on commit 284c0d4

Please sign in to comment.