Bugfix/change client-side dates to be sent in UTC format (#4402)
* Change client-side dates to be sent in UTC format * Update changelog
This commit is contained in:
parent
4db8c007f0
commit
235db72ade
@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Fixed
|
||||
|
||||
- Fixed an issue in the activities import functionality related to the account balances
|
||||
- Changed client-side dates to be sent in UTC format to ensure date consistency
|
||||
- Benchmark endpoint
|
||||
- Exchange rate endpoint
|
||||
|
||||
## 2.146.0 - 2025-03-15
|
||||
|
||||
|
@ -8,7 +8,6 @@ import {
|
||||
PROPERTY_API_KEY_GHOSTFOLIO
|
||||
} from '@ghostfolio/common/config';
|
||||
import { DEFAULT_PAGE_SIZE } from '@ghostfolio/common/config';
|
||||
import { DATE_FORMAT } from '@ghostfolio/common/helper';
|
||||
import {
|
||||
AssetProfileIdentifier,
|
||||
AdminData,
|
||||
@ -25,7 +24,6 @@ import { Injectable } from '@angular/core';
|
||||
import { SortDirection } from '@angular/material/sort';
|
||||
import { DataSource, MarketData, Platform } from '@prisma/client';
|
||||
import { JobStatus } from 'bull';
|
||||
import { format } from 'date-fns';
|
||||
import { switchMap } from 'rxjs';
|
||||
|
||||
import { environment } from '../../environments/environment';
|
||||
@ -186,19 +184,8 @@ export class AdminService {
|
||||
);
|
||||
}
|
||||
|
||||
public gatherSymbol({
|
||||
dataSource,
|
||||
date,
|
||||
symbol
|
||||
}: AssetProfileIdentifier & {
|
||||
date?: Date;
|
||||
}) {
|
||||
let url = `/api/v1/admin/gather/${dataSource}/${symbol}`;
|
||||
|
||||
if (date) {
|
||||
url = `${url}/${format(date, DATE_FORMAT)}`;
|
||||
}
|
||||
|
||||
public gatherSymbol({ dataSource, symbol }: AssetProfileIdentifier) {
|
||||
const url = `/api/v1/admin/gather/${dataSource}/${symbol}`;
|
||||
return this.http.post<MarketData | void>(url, {});
|
||||
}
|
||||
|
||||
|
@ -57,6 +57,7 @@ import { translate } from '@ghostfolio/ui/i18n';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { SortDirection } from '@angular/material/sort';
|
||||
import { utc } from '@date-fns/utc';
|
||||
import {
|
||||
AccountBalance,
|
||||
DataSource,
|
||||
@ -281,7 +282,7 @@ export class DataService {
|
||||
symbol: string;
|
||||
}) {
|
||||
return this.http.get<IDataProviderHistoricalResponse>(
|
||||
`/api/v1/exchange-rate/${symbol}/${format(date, DATE_FORMAT)}`
|
||||
`/api/v1/exchange-rate/${symbol}/${format(date, DATE_FORMAT, { in: utc })}`
|
||||
);
|
||||
}
|
||||
|
||||
@ -363,10 +364,7 @@ export class DataService {
|
||||
}
|
||||
|
||||
return this.http.get<BenchmarkMarketDataDetails>(
|
||||
`/api/v1/benchmarks/${dataSource}/${symbol}/${format(
|
||||
startDate,
|
||||
DATE_FORMAT
|
||||
)}`,
|
||||
`/api/v1/benchmarks/${dataSource}/${symbol}/${format(startDate, DATE_FORMAT, { in: utc })}`,
|
||||
{ params }
|
||||
);
|
||||
}
|
||||
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -22,6 +22,7 @@
|
||||
"@angular/router": "19.2.1",
|
||||
"@angular/service-worker": "19.2.1",
|
||||
"@codewithdan/observable-store": "2.2.15",
|
||||
"@date-fns/utc": "2.1.0",
|
||||
"@dfinity/agent": "0.15.7",
|
||||
"@dfinity/auth-client": "0.15.7",
|
||||
"@dfinity/candid": "0.15.7",
|
||||
@ -3113,6 +3114,11 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@date-fns/utc": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@date-fns/utc/-/utc-2.1.0.tgz",
|
||||
"integrity": "sha512-176grgAgU2U303rD2/vcOmNg0kGPbhzckuH1TEP2al7n0AQipZIy9P15usd2TKQCG1g+E1jX/ZVQSzs4sUDwgA=="
|
||||
},
|
||||
"node_modules/@dfinity/agent": {
|
||||
"version": "0.15.7",
|
||||
"resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-0.15.7.tgz",
|
||||
|
@ -68,6 +68,7 @@
|
||||
"@angular/router": "19.2.1",
|
||||
"@angular/service-worker": "19.2.1",
|
||||
"@codewithdan/observable-store": "2.2.15",
|
||||
"@date-fns/utc": "2.1.0",
|
||||
"@dfinity/agent": "0.15.7",
|
||||
"@dfinity/auth-client": "0.15.7",
|
||||
"@dfinity/candid": "0.15.7",
|
||||
|
Loading…
x
Reference in New Issue
Block a user