mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
when time get overwritten/updated, we need to set last time, to avoid error that time can not be set before last action
This commit is contained in:
parent
4c1e2a268e
commit
38e7a977d1
@ -543,11 +543,18 @@ egw.extend('timer', egw.MODULE_GLOBAL, function()
|
||||
{
|
||||
timer.offset -= action === 'start' ? -change : change;
|
||||
update();
|
||||
// for stop/pause set last time, otherwise we might not able to start again directly after
|
||||
if (action !== 'start')
|
||||
{
|
||||
timer.last = new Date(timer[action]);
|
||||
}
|
||||
}
|
||||
// for a running timer, we need to adjust the (virtual) start too
|
||||
else if (timer.start)
|
||||
{
|
||||
timer.start = new Date(timer.start.valueOf() - change);
|
||||
// for running timer set last time, otherwise we might not able to stop directly after
|
||||
timer.last = new Date(timer.start);
|
||||
}
|
||||
egw.request('timesheet.EGroupware\\Timesheet\\Events.ajax_updateTime',
|
||||
[tse_id, new Date((new Date(_values.time)).valueOf() + egw.getTimezoneOffset() * 60000)])
|
||||
|
Loading…
Reference in New Issue
Block a user