diff --git a/api/etemplate.php b/api/etemplate.php index 2a23c10f63..320d517beb 100644 --- a/api/etemplate.php +++ b/api/etemplate.php @@ -76,8 +76,8 @@ function send_template() str_replace($type[0], '', $matches[0]); list($matches[1], $matches[2]) = explode('-', $type[1], 2); } - static $legacy_options = array( - 'select' => 'empty_label,dummy', + static $legacy_options = array( // use "ignore" to ignore further comma-sep. values, otherwise they are all in last attribute + 'select' => 'empty_label,ignore', 'box' => ',cellpadding,cellspacing,keep', 'hbox' => 'cellpadding,cellspacing,keep', 'vbox' => 'cellpadding,cellspacing,keep', @@ -85,7 +85,7 @@ function send_template() 'checkbox' => 'selected_value,unselected_value,ro_true,ro_false', 'radio' => 'set_value,ro_true,ro_false', 'customfields' => 'sub-type,use-private,field-names', - 'date' => 'data_format', // Legacy option "mode" was never implemented in et2 + 'date' => 'data_format,ignore', // Legacy option "mode" was never implemented in et2 'description' => 'bold-italic,link,activate_links,label_for,link_target,link_popup_size,link_title', ); // prefer more specific type-subtype over just type @@ -99,6 +99,7 @@ function send_template() $values = array_merge($values, array_fill(count($values), count($names)-count($values), '')); } $attrs = array_diff(array_combine($names, $values), ['', null]); + unset($attrs['ignore']); // fix select options can be either multiple or empty_label if ($matches[1] === 'select' && !empty($attrs['empty_label']) && (int)$attrs['empty_label'] > 0) { diff --git a/api/js/etemplate/Et2Date/Et2DateDuration.ts b/api/js/etemplate/Et2Date/Et2DateDuration.ts index 7498a9f484..7e58523ddb 100644 --- a/api/js/etemplate/Et2Date/Et2DateDuration.ts +++ b/api/js/etemplate/Et2Date/Et2DateDuration.ts @@ -186,6 +186,7 @@ export class Et2DateDuration extends Et2InputWidget(FormControlMixin(LitElement) * Default is true */ select_unit: { + reflect: true, type: Boolean }, @@ -451,7 +452,7 @@ export class Et2DateDuration extends Et2InputWidget(FormControlMixin(LitElement) _value = Math.floor(_value / 3600); return _highest ? _value : _value % this.hours_per_day; case 'd': - return Math.floor(_value / 3600 * this.hours_per_day); + return Math.floor(_value / 3600 / this.hours_per_day); } } diff --git a/api/js/etemplate/et2_widget_date.ts b/api/js/etemplate/et2_widget_date.ts index 39d668ac8e..a07ab85f91 100644 --- a/api/js/etemplate/et2_widget_date.ts +++ b/api/js/etemplate/et2_widget_date.ts @@ -938,7 +938,7 @@ export class et2_date_duration extends et2_date _value = Math.floor(_value / 3600); return _highest ? _value : _value % this.options.hours_per_day; case 'd': - return Math.floor(_value / 3600*this.options.hours_per_day); + return Math.floor(_value / 3600 / this.options.hours_per_day); } } diff --git a/timesheet/templates/default/index.xet b/timesheet/templates/default/index.xet index df5868f7f5..8b185c2cf9 100644 --- a/timesheet/templates/default/index.xet +++ b/timesheet/templates/default/index.xet @@ -81,7 +81,7 @@ - + @@ -101,4 +101,4 @@ - + \ No newline at end of file