mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
Change ParkingStructureCountOptions and HistoricalParkingAverageQueryResult to use Date objects
This matches the behavior of `updatedTime` on shuttle objects. When returning API data, dates are converted into milliseconds since Epoch by the DateTime scalar implementation.
This commit is contained in:
@@ -16,7 +16,7 @@ export interface NotificationAlertArguments {
|
||||
|
||||
export class AppleNotificationSender {
|
||||
private apnsToken: string | undefined = undefined;
|
||||
private _lastRefreshedTimeMs: number | undefined = undefined;
|
||||
private _lastRefreshedTimeMs: Date | undefined = undefined;
|
||||
|
||||
constructor(
|
||||
private shouldActuallySendNotifications = true,
|
||||
@@ -34,13 +34,13 @@ export class AppleNotificationSender {
|
||||
}
|
||||
}
|
||||
|
||||
get lastRefreshedTimeMs(): number | undefined {
|
||||
get lastRefreshedTimeMs(): Date | undefined {
|
||||
return this._lastRefreshedTimeMs;
|
||||
}
|
||||
|
||||
private lastReloadedTimeForAPNsIsTooRecent() {
|
||||
const thirtyMinutesMs = 1800000;
|
||||
return this._lastRefreshedTimeMs && Date.now() - this._lastRefreshedTimeMs < thirtyMinutesMs;
|
||||
return this._lastRefreshedTimeMs && Date.now() - this._lastRefreshedTimeMs.getTime() < thirtyMinutesMs;
|
||||
}
|
||||
|
||||
public reloadAPNsTokenIfTimePassed() {
|
||||
@@ -70,7 +70,7 @@ export class AppleNotificationSender {
|
||||
algorithm: "ES256",
|
||||
header: tokenHeader
|
||||
});
|
||||
this._lastRefreshedTimeMs = nowMs;
|
||||
this._lastRefreshedTimeMs = new Date(nowMs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user