Add lastStamp to availability and show it on people tiles
Server query extended with MAX(BU_BU) per user as LAST_STAMP, exposed via the Availability model. Client formats it as DD.MM. HH:mm next to the loggedIn dot, replacing the mocked time.
This commit is contained in:
@@ -2,4 +2,5 @@ export class AvailabilityInfo {
|
||||
public user: string;
|
||||
public loggedIn: boolean;
|
||||
public extension: string;
|
||||
public lastStamp: string;
|
||||
}
|
||||
|
||||
@@ -65,8 +65,13 @@ export class Availability {
|
||||
return
|
||||
}
|
||||
var dotClass = entry.loggedIn ? 'tapi-dot-on' : 'tapi-dot-off'
|
||||
var mockedTime = '13.04. 08:30'
|
||||
indicator.innerHTML = '<span class="tapi-dot ' + dotClass + '"></span><small>' + mockedTime + '</small>'
|
||||
var time = ''
|
||||
if (entry.lastStamp) {
|
||||
var d = new Date(entry.lastStamp)
|
||||
var pad = (n: number) => n.toString().padStart(2, '0')
|
||||
time = pad(d.getDate()) + '.' + pad(d.getMonth() + 1) + '. ' + pad(d.getHours()) + ':' + pad(d.getMinutes())
|
||||
}
|
||||
indicator.innerHTML = '<span class="tapi-dot ' + dotClass + '"></span><small>' + time + '</small>'
|
||||
}
|
||||
|
||||
private updateSquare(square: HTMLElement) {
|
||||
|
||||
Reference in New Issue
Block a user