Make sure there's string to be replaced

This commit is contained in:
Hadi Nategh 2014-12-05 11:04:42 +00:00
parent 9b5c68f743
commit 14230d10f7

View File

@ -414,7 +414,7 @@ var et2_date = et2_inputWidget.extend(
// Convert to timestamp - no seconds // Convert to timestamp - no seconds
this.date.setSeconds(0,0); this.date.setSeconds(0,0);
return this.date.toJSON().replace(/\.\d{3}Z$/, 'Z'); return this.date?this.date.toJSON().replace(/\.\d{3}Z$/, 'Z'):this.date;
} }
}); });
et2_register_widget(et2_date, ["date", "date-time", "date-timeonly"]); et2_register_widget(et2_date, ["date", "date-time", "date-timeonly"]);