forked from extern/egroupware
Make sure the toJSON is not null before using string replace
This commit is contained in:
parent
d3d84782a5
commit
56d8947ccc
@ -414,7 +414,7 @@ var et2_date = et2_inputWidget.extend(
|
||||
|
||||
// Convert to timestamp - no seconds
|
||||
this.date.setSeconds(0,0);
|
||||
return this.date?this.date.toJSON().replace(/\.\d{3}Z$/, 'Z'):this.date;
|
||||
return (this.date && typeof this.date.toJSON != 'undefined' && this.date.toJSON())?this.date.toJSON().replace(/\.\d{3}Z$/, 'Z'):this.date;
|
||||
}
|
||||
});
|
||||
et2_register_widget(et2_date, ["date", "date-time", "date-timeonly"]);
|
||||
|
Loading…
Reference in New Issue
Block a user