From 14230d10f738c889a1649fdc85a6671998fba362 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 5 Dec 2014 11:04:42 +0000 Subject: [PATCH] Make sure there's string to be replaced --- etemplate/js/et2_widget_date.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_date.js b/etemplate/js/et2_widget_date.js index 9c76e15aee..42eeceea94 100644 --- a/etemplate/js/et2_widget_date.js +++ b/etemplate/js/et2_widget_date.js @@ -414,7 +414,7 @@ var et2_date = et2_inputWidget.extend( // Convert to timestamp - no seconds 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"]);