geomon.viewer/src/shared/models/timespan.ts
Arno Kaimbacher 4241bd2cb9 - add "moment": "^2.29.1" and "chartjs-adapter-moment": "^1.0.0",
- add core module for time.service.ts
- add interfaces for timespan.ts an dataset.ts
2021-09-28 16:26:53 +02:00

30 lines
No EOL
664 B
TypeScript

export abstract class TimeInterval {
}
export class Timespan extends TimeInterval{
public from: number;
public to: number;
constructor(from: number | Date, to?: number | Date) {
super();
this.from = from instanceof Date ? from.valueOf() : from;
this.to = to ? (to instanceof Date ? to.valueOf() : to) : this.from;
}
}
export class BufferedTime extends TimeInterval {
public timestamp: Date;
public bufferInterval: number;
constructor(
timestamp: Date,
bufferInterval: number
) {
super();
this.timestamp = timestamp;
this.bufferInterval = bufferInterval;
}
}