Fix Bug 2293: Password Expiry and Account Expiry Time Issue for today & tomorrow...
[osm/NG-UI.git] / src / services / SharedService.ts
index 8abe1d2..ba805e6 100644 (file)
@@ -191,8 +191,12 @@ export class SharedService {
         if (!isNullOrUndefined(date)) {
             const today: Date = new Date();
             const accountDate: Date = new Date(date);
-            return Math.floor((accountDate.getTime() -
-                today.getTime()) / this.epochTime1000 / this.epochTime60 / this.epochTime60 / this.epochTime24);
+            const toasterDate: number = (accountDate.getTime() -
+                today.getTime()) / this.epochTime1000 / this.epochTime60 / this.epochTime60 / this.epochTime24;
+            if (toasterDate >= 0 || toasterDate < 1) {
+                return Math.round(toasterDate);
+            }
+            return Math.floor(toasterDate);
         }
         return this.translateService.instant('N/A');
     }