fix(timestamp): add missing .isOlderThanOtherTimeStamp() to TimeStamp class
This commit is contained in:
parent
da9c71eedb
commit
a2ffdd436f
@ -53,6 +53,19 @@ export class TimeStamp {
|
|||||||
this.epochtime = Math.floor(this.milliSeconds / 1000);
|
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
|
* Is the current instance older than the argument
|
||||||
* @param TimeStampArg
|
* @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 TimeStampArg
|
||||||
* @param tresholdTimeArg
|
* @param tresholdTimeArg
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user