mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-05 12:19:58 +08:00
Merge pull request #6920 from SylvainCorlay/serialize_date
Dates and Strings are JavaScript objects, and _pack_models behaves incorrectly in these cases.
This commit is contained in:
commit
f569ccc58f
@ -236,7 +236,8 @@ define(["widgets/js/manager",
|
|||||||
packed.push(that._pack_models(sub_value));
|
packed.push(that._pack_models(sub_value));
|
||||||
});
|
});
|
||||||
return packed;
|
return packed;
|
||||||
|
} else if (value instanceof Date || value instanceof String) {
|
||||||
|
return value;
|
||||||
} else if (value instanceof Object) {
|
} else if (value instanceof Object) {
|
||||||
packed = {};
|
packed = {};
|
||||||
_.each(value, function(sub_value, key) {
|
_.each(value, function(sub_value, key) {
|
||||||
|
@ -81,6 +81,7 @@ casper.notebook_test(function () {
|
|||||||
test_packing([1, false]);
|
test_packing([1, false]);
|
||||||
test_packing([1, false, {a: 'hi'}]);
|
test_packing([1, false, {a: 'hi'}]);
|
||||||
test_packing([1, false, ['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.
|
// Test multi-set, single touch code. First create a custom widget.
|
||||||
this.evaluate(function() {
|
this.evaluate(function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user