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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
12 additions and
3 deletions
-
CHANGELOG.md
-
apps/client/src/app/pages/admin/admin-page.component.ts
|
@ -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 |
|
|
|
@ -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; |
|
|
} |
|
|
} |
|
|