balderdashy/sails — pull request #2435 by Dallas62 (2014-11-24 19:48:18+00:00)
Title: Update actionUtil.js

Hi!
Values are not parse well when you use blueprint,
if you run the `npm test` of an adapter, you will have greaterThan and lessThan tests on Dates. Those tests generate data and when you run the adapted test for blueprints:
`http://localhost:1337/api/user2/?where=%7B%22type%22%3A%22lessThanOrEqual%20dates%20test%22%2C%22dob%22%3A%7B%22%3C%3D%22%3A%222013-11-01T23%3A00%3A00.000Z%22%7D%7D`
from
```
it('should return records with lessThanOrEqual key when searching dates', function(done) {
Queryable.User.find({ type: testName, dob: { lessThanOrEqual: new Date(2013, 10, 2) }}).sort('first_name').exec(function(err, users) {
assert(!err);
assert(Array.isArray(users));
assert(users.length === 2);
assert(users[1].first_name === 'lessThanOrEqual_dates_user1');
done();
});
});

it('should return records with symbolic usage <= usage when searching dates', function(done) {
Queryable.User.find({ type: testName, dob: { '<=': new Date(2013, 10, 2) }}).sort('first_name').exec(function(err, users) {
assert(!err);
assert(Array.isArray(users));
assert(users.length === 2);
assert(users[1].first_name === 'lessThanOrEqual_dates_user1');
done();
});
});
```
The result is an Array of ONE model ( TWO expected ). (with sails-mysql and maybe other)

This fix is not THE answer to fix this, but it's work.

And replace tryParse by sails-util.tolerantParse.