diff --git a/ts/smarttime.classes.timestamp.ts b/ts/smarttime.classes.timestamp.ts index 6546e46..63cd6aa 100644 --- a/ts/smarttime.classes.timestamp.ts +++ b/ts/smarttime.classes.timestamp.ts @@ -53,6 +53,19 @@ export class TimeStamp { this.epochtime = Math.floor(this.milliSeconds / 1000); } + /** + * returns a boolean for wether the timestamp is older than another timestamp + * @param TimeStampArg + * @param tresholdTimeArg + */ + public isOlderThanOtherTimeStamp(TimeStampArg: TimeStamp, tresholdTimeArg: number = 0) { + if (this.milliSeconds < TimeStampArg.milliSeconds - tresholdTimeArg) { + return true; + } else { + return false; + } + } + /** * Is the current instance older than the argument * @param TimeStampArg @@ -66,7 +79,7 @@ export class TimeStamp { } /** - * returns a boolean for wether a timestamp is younger + * returns a boolean for wether the timestamp is younger than another timestamp * @param TimeStampArg * @param tresholdTimeArg */