Skip to content

Commit

Permalink
Merge pull request #265 from scireum/phu/SIRI-46_correctIntervalCalcu…
Browse files Browse the repository at this point in the history
…lation

SIRI-46 Calculates the interval to the last external login correctly.
  • Loading branch information
andyHa authored Feb 22, 2019
2 parents e0a2c0c + d6ecc9f commit 04d5bf9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/sirius/biz/tenants/TenantUserManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ private boolean isWithinInterval(LocalDateTime dateTime, Integer requiredInterva
return false;
}

long actualInterval = Duration.between(LocalDateTime.now(), dateTime).toDays();
long actualInterval = Duration.between(dateTime, LocalDateTime.now()).toDays();
return actualInterval < requiredInterval;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/sirius/biz/tenants/UserAccountData.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private boolean isNearInterval(LocalDateTime dateTime, Integer requiredInterval)
return true;
}

long actualInterval = Duration.between(LocalDateTime.now(), dateTime).toDays();
long actualInterval = Duration.between(dateTime, LocalDateTime.now()).toDays();
return actualInterval >= requiredInterval - 3;
}

Expand Down

0 comments on commit 04d5bf9

Please sign in to comment.