mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
Timesheet: Update quantity placeholder when duration changes, including decimal separator
This commit is contained in:
parent
e034557f60
commit
3dff71c8d1
@ -372,7 +372,7 @@ class timesheet_ui extends timesheet_bo
|
||||
'to_app' => TIMESHEET_APP,
|
||||
),
|
||||
'ts_quantity_blur' => $this->data['ts_duration'] ? round($this->data['ts_duration'] / 60.0, 3) : '',
|
||||
'ts_quantity' => $this->data['ts_duration']/60.0 == $this->data['ts_quantity'] ? null : $this->data['ts_quantity'],
|
||||
'ts_quantity' => $this->data['ts_duration'] / 60.0 == $this->data['ts_quantity'] ? null : (float)$this->data['ts_quantity'],
|
||||
'start_time' => isset($this->data['start_time']) ? $this->data['start_time'] : $this->data['ts_start'],
|
||||
'pm_integration' => $this->pm_integration,
|
||||
'no_ts_status' => !$this->status_labels && ($this->data['ts_status'] != self::DELETED_STATUS),
|
||||
|
@ -202,8 +202,18 @@ class TimesheetApp extends EgwApp
|
||||
const quantity = this.et2.getWidgetById("ts_quantity");
|
||||
if(quantity)
|
||||
{
|
||||
// use decimal separator from user prefs
|
||||
const format = this.egw.preference('number_format');
|
||||
const sep = format ? format[0] : '.';
|
||||
|
||||
// Duration is in minutes, round to hours with 1 decimal
|
||||
quantity.placeholder = Math.round(parseInt(widget.value) / 6) / 10;
|
||||
let val = "" + (Math.round(parseInt(widget.value) / 6) / 10);
|
||||
if(format && sep && sep !== '.')
|
||||
{
|
||||
val = val.replace('.', sep);
|
||||
}
|
||||
|
||||
quantity.placeholder = val;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user