diff --git a/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js b/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js index abeac571c..0440d25db 100644 --- a/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js +++ b/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js @@ -181,7 +181,7 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, { this.R.setValue(BI.isNull(json.r) ? "" : json.r); this.G.setValue(BI.isNull(json.g) ? "" : json.g); this.B.setValue(BI.isNull(json.b) ? "" : json.b); - this.hexEditor.setValue(color.slice(this.constants.HEX_PREFIX_POSITION)); + this.hexEditor.setValue(BI.isEmptyObject(json) ? "" : color.slice(this.constants.HEX_PREFIX_POSITION)); }, getValue: function () { diff --git a/src/core/__test__/base.test.js b/src/core/__test__/base.test.js index 16b16ec25..558191d02 100644 --- a/src/core/__test__/base.test.js +++ b/src/core/__test__/base.test.js @@ -437,7 +437,8 @@ describe("baseFunctionTest", function () { * test_author_teller * 只传一个时分秒format的时间进去后,在某些情况下,返回的是当前时间,然而想要的是返回正确的时分秒 */ - it("parseDateTime", function () { - expect(BI.parseDateTime("14:13:16", "%H:%M:%S").getTime()).to.eql(1602655996000); + it("parseDateTime2", function () { + var date = BI.getDate(); + expect(BI.parseDateTime("14:13:16", "%H:%M:%S").getTime()).to.eql(BI.getDate(date.getFullYear(), date.getMonth(), 14, 14, 13, 16).getTime()); }); });