Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/change uptime to last 90 days (#1993)

Thomas Kaul655a68a847a1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 87ee494842..695f931100 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Improved the local number formatting in the value component
+- Changed the uptime to the last 90 days on the _Open Startup_ (`/open`) page
### Fixed
diff --git a/apps/api/src/app/info/info.service.ts b/apps/api/src/app/info/info.service.ts
index 8af8e6ee2d..187135a351 100644
--- a/apps/api/src/app/info/info.service.ts
+++ b/apps/api/src/app/info/info.service.ts
@@ -17,6 +17,7 @@ import {
ghostfolioFearAndGreedIndexDataSource
} from '@ghostfolio/common/config';
import {
+ DATE_FORMAT,
encodeDataSource,
extractNumberFromString
} from '@ghostfolio/common/helper';
@@ -31,7 +32,7 @@ import { Injectable, Logger } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';
import * as bent from 'bent';
import * as cheerio from 'cheerio';
-import { subDays } from 'date-fns';
+import { format, subDays } from 'date-fns';
@Injectable()
export class InfoService {
@@ -346,7 +347,10 @@ export class InfoService {
)) as string;
const get = bent(
- `https://betteruptime.com/api/v2/monitors/${monitorId}/sla`,
+ `https://betteruptime.com/api/v2/monitors/${monitorId}/sla?from=${format(
+ subDays(new Date(), 90),
+ DATE_FORMAT
+ )}&to${format(new Date(), DATE_FORMAT)}`,
'GET',
'json',
200,
diff --git a/apps/client/src/app/pages/open/open-page.html b/apps/client/src/app/pages/open/open-page.html
index 81b4dcd4e6..62503e3875 100644
--- a/apps/client/src/app/pages/open/open-page.html
+++ b/apps/client/src/app/pages/open/open-page.html
@@ -109,6 +109,7 @@
<a class="d-block" href="https://status.ghostfol.io">
<gf-value
size="large"
+ subLabel="(Last 90 days)"
[isPercent]="true"
[locale]="user?.settings?.locale"
[precision]="2"