Browse Source

Bugfix/fix last activity column (#158)

* Fix last activity (only values in the past)

* Update changelog
pull/159/head
Thomas 4 years ago
committed by GitHub
parent
commit
c519eb0e99
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      CHANGELOG.md
  2. 11
      apps/client/src/app/pages/admin/admin-page.component.ts

4
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 - Cleaned up the analysis page with an unused chart module
- Improved the cell alignment in the users table of the admin control panel - 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 ## 1.14.0 - 09.06.2021
### Added ### Added

11
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 { UserService } from '@ghostfolio/client/services/user/user.service';
import { DEFAULT_DATE_FORMAT } from '@ghostfolio/common/config'; import { DEFAULT_DATE_FORMAT } from '@ghostfolio/common/config';
import { AdminData, User } from '@ghostfolio/common/interfaces'; 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 { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
@ -80,8 +85,8 @@ export class AdminPageComponent implements OnInit {
addSuffix: true addSuffix: true
}); });
return distanceString === 'in 0 seconds' || return Math.abs(differenceInSeconds(parseISO(aDateString), new Date())) <
distanceString === '0 seconds ago' 60
? 'just now' ? 'just now'
: distanceString; : distanceString;
} }

Loading…
Cancel
Save