From 0700876775ecbadd3e4fe2a00670c02f0938f6e2 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 12 Oct 2011 20:04:16 +0000 Subject: [PATCH] Handle null values --- etemplate/js/et2_widget_date.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/etemplate/js/et2_widget_date.js b/etemplate/js/et2_widget_date.js index f9c299461f..98151f5089 100644 --- a/etemplate/js/et2_widget_date.js +++ b/etemplate/js/et2_widget_date.js @@ -193,6 +193,21 @@ var et2_date = et2_inputWidget.extend({ }, set_value: function(_value) { + if(_value == null) + { + this.value = _value; + + if(this.input_date) + { + this.input_date.val(""); + } + if(this.input_time) + { + this.input_time.val(""); + } + return; + } + // Handle just time as a string in the form H:i if(typeof _value == 'string' && isNaN(_value)) { if(_value.indexOf(":") > 0 && this.type == "date-timeonly") {