Compare commits

...

2 Commits

Author SHA1 Message Date
c3a772c155 3.0.43 2021-11-08 16:56:11 +01:00
a2ffdd436f fix(timestamp): add missing .isOlderThanOtherTimeStamp() to TimeStamp class 2021-11-08 16:56:11 +01:00
3 changed files with 17 additions and 4 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@pushrocks/smarttime",
"version": "3.0.42",
"version": "3.0.43",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@pushrocks/smarttime",
"version": "3.0.42",
"version": "3.0.43",
"license": "MIT",
"dependencies": {
"@pushrocks/lik": "^5.0.0",

View File

@ -1,7 +1,7 @@
{
"name": "@pushrocks/smarttime",
"private": false,
"version": "3.0.42",
"version": "3.0.43",
"description": "handle time in smart ways",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",

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