Merge pull request #6920 from SylvainCorlay/serialize_date

Dates and Strings are JavaScript objects, and _pack_models behaves incorrectly in these cases.
Min RK 12 years ago
commit f569ccc58f

@ -236,7 +236,8 @@ define(["widgets/js/manager",
packed.push(that._pack_models(sub_value));
});
return packed;
} else if (value instanceof Date || value instanceof String) {
return value;
} else if (value instanceof Object) {
packed = {};
_.each(value, function(sub_value, key) {

@ -81,6 +81,7 @@ casper.notebook_test(function () {
test_packing([1, false]);
test_packing([1, false, {a: 'hi'}]);
test_packing([1, false, ['hi']]);
test_packing([String('hi'), Date("Thu Nov 13 2014 13:46:21 GMT-0500")])
// Test multi-set, single touch code. First create a custom widget.
this.evaluate(function() {

Loading…
Cancel
Save