backbone-db
Advanced tools
Comparing version 0.4.22 to 0.4.23
@@ -73,2 +73,9 @@ var Backbone = require('backbone'); | ||
return val.toString(); | ||
} else if (_.isDate(val)) { | ||
return val.toString(); | ||
} else if (_.isObject(val)) { | ||
_.each(val, function(v, k) { | ||
if (_.isDate(v)) val[k] = v.toString(); | ||
}); | ||
return val; | ||
} else { | ||
@@ -75,0 +82,0 @@ return val; |
{ | ||
"name": "backbone-db", | ||
"version": "0.4.22", | ||
"version": "0.4.23", | ||
"description": "Key-Value database storage interface, localStorage and in-process implementations", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -55,3 +55,4 @@ var assert = require('assert'); | ||
test: 1, | ||
arr: ['foo', 'bar'] | ||
arr: ['foo', 'bar'], | ||
d: new Date() | ||
}, { | ||
@@ -61,3 +62,4 @@ success: function(model) { | ||
m.create({ | ||
test: 2 | ||
test: 2, | ||
d: new Date() | ||
}, { | ||
@@ -255,2 +257,20 @@ success: function(model) { | ||
it('should query models with Date & $lte', function(t) { | ||
var collection = new this.Collection(); | ||
collection.fetch({ | ||
where: { | ||
d: { | ||
$lte: new Date() | ||
} | ||
}, | ||
success: function() { | ||
assert.equal(collection.length, 2); | ||
t(); | ||
}, | ||
error: function(coll, err) { | ||
t(err); | ||
} | ||
}); | ||
}); | ||
it('should remove a model from collection when destroyed', function(t) { | ||
@@ -257,0 +277,0 @@ var m = new this.Collection(); |
33092
13
915