diff --git a/CHANGELOG.md b/CHANGELOG.md index d2a1f6093..2ed8331eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Cleaned up the analysis page with an unused chart module - Improved the cell alignment in the users table of the admin control panel +### Fixed + +- Fixed the last activity column of users in the admin control panel + ## 1.14.0 - 09.06.2021 ### Added diff --git a/apps/client/src/app/pages/admin/admin-page.component.ts b/apps/client/src/app/pages/admin/admin-page.component.ts index f0b3e3d45..cb3b2544b 100644 --- a/apps/client/src/app/pages/admin/admin-page.component.ts +++ b/apps/client/src/app/pages/admin/admin-page.component.ts @@ -5,7 +5,12 @@ import { DataService } from '@ghostfolio/client/services/data.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; import { DEFAULT_DATE_FORMAT } from '@ghostfolio/common/config'; import { AdminData, User } from '@ghostfolio/common/interfaces'; -import { formatDistanceToNowStrict, isValid, parseISO } from 'date-fns'; +import { + differenceInSeconds, + formatDistanceToNowStrict, + isValid, + parseISO +} from 'date-fns'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; @@ -80,8 +85,8 @@ export class AdminPageComponent implements OnInit { addSuffix: true }); - return distanceString === 'in 0 seconds' || - distanceString === '0 seconds ago' + return Math.abs(differenceInSeconds(parseISO(aDateString), new Date())) < + 60 ? 'just now' : distanceString; }