mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +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));
|
||||
});
|
||||
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…
Reference in New Issue
Block a user