Parse lastStamp as Date in AvailabilityService
Type AvailabilityInfo.lastStamp as Date and convert from the JSON string in the service after fetch, so consumers work with real Date objects.
This commit is contained in:
@@ -67,8 +67,8 @@ export class Availability {
|
||||
var dotClass = entry.loggedIn ? 'tapi-dot-on' : 'tapi-dot-off'
|
||||
var time = ''
|
||||
if (entry.lastStamp) {
|
||||
var d = new Date(entry.lastStamp)
|
||||
var pad = (n: number) => n.toString().padStart(2, '0')
|
||||
var d = entry.lastStamp
|
||||
time = pad(d.getDate()) + '.' + pad(d.getMonth() + 1) + '. ' + pad(d.getHours()) + ':' + pad(d.getMinutes())
|
||||
}
|
||||
var location = ''
|
||||
|
||||
Reference in New Issue
Block a user