From 860d37912b4c75609712da759d84e9c189215b8b Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 22 Sep 2011 21:28:26 +0000 Subject: [PATCH] If value is '', don't show a unit either --- etemplate/js/et2_widget_date.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etemplate/js/et2_widget_date.js b/etemplate/js/et2_widget_date.js index ea235fabe7..f9c299461f 100644 --- a/etemplate/js/et2_widget_date.js +++ b/etemplate/js/et2_widget_date.js @@ -448,6 +448,9 @@ var et2_date_duration = et2_date.extend({ } _value = this.options.empty_not_0 && _value === '' || !this.options.empty_not_0 && !_value ? '' : (_unit == 'm' ? parseInt( _value) : (Math.round((_value / 60.0 / (_unit == 'd' ? this.options.hours_per_day : 1))*100)/100)); + + if(_value === '') _unit = ''; + // use decimal separator from user prefs var sep = '.'; var format = egw.preference('number_format');