mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 17:04:14 +01:00
Timesheet: Update quantity placeholder when duration changes
This commit is contained in:
parent
59ea901cf9
commit
250beda64e
@ -192,6 +192,21 @@ class TimesheetApp extends EgwApp
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If editing a timesheet and no quantity is set, update the placeholder text when duration changes
|
||||
*
|
||||
* This is for display only
|
||||
*/
|
||||
update_quantity(event, widget)
|
||||
{
|
||||
const quantity = this.et2.getWidgetById("ts_quantity");
|
||||
if(quantity)
|
||||
{
|
||||
// Duration is in minutes, round to hours with 1 decimal
|
||||
quantity.placeholder = Math.round(parseInt(widget.value) / 6) / 10;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get title in order to set it as document title
|
||||
* @returns {string}
|
||||
|
@ -138,7 +138,8 @@
|
||||
</row>
|
||||
<row class="row dialogHeader3">
|
||||
<et2-description value="Duration" for="ts_duration"></et2-description>
|
||||
<et2-date-duration id="ts_duration" displayFormat="hm"></et2-date-duration>
|
||||
<et2-date-duration id="ts_duration" displayFormat="hm"
|
||||
onchange="app.timesheet.update_quantity"></et2-date-duration>
|
||||
<et2-description></et2-description>
|
||||
<et2-description value="or endtime" class="et2_noWrap"></et2-description>
|
||||
<et2-date-timeonly id="end_time"></et2-date-timeonly>
|
||||
|
Loading…
Reference in New Issue
Block a user