fix(timestamp): add missing .isOlderThanOtherTimeStamp() to TimeStamp class

This commit is contained in:
Philipp Kunz 2021-11-08 16:56:11 +01:00
parent da9c71eedb
commit a2ffdd436f

View File

@ -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
*/