bugfixing
This commit is contained in:
parent
05b9d7095f
commit
999e97367f
8
package-lock.json
generated
8
package-lock.json
generated
@ -35,7 +35,7 @@
|
||||
"compression": "^1.7.4",
|
||||
"d3-hierarchy": "^3.1.2",
|
||||
"d3-sankey": "^0.12.3",
|
||||
"daisyui": "^4.12.23",
|
||||
"daisyui": "^4.12.24",
|
||||
"date-fns": "^3.6.0",
|
||||
"date-fns-tz": "^3.1.3",
|
||||
"date-picker-svelte": "^2.12.0",
|
||||
@ -4093,9 +4093,9 @@
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/daisyui": {
|
||||
"version": "4.12.23",
|
||||
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-4.12.23.tgz",
|
||||
"integrity": "sha512-EM38duvxutJ5PD65lO/AFMpcw+9qEy6XAZrTpzp7WyaPeO/l+F/Qiq0ECHHmFNcFXh5aVoALY4MGrrxtCiaQCQ==",
|
||||
"version": "4.12.24",
|
||||
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-4.12.24.tgz",
|
||||
"integrity": "sha512-JYg9fhQHOfXyLadrBrEqCDM6D5dWCSSiM6eTNCRrBRzx/VlOCrLS8eDfIw9RVvs64v2mJdLooKXY8EwQzoszAA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
"compression": "^1.7.4",
|
||||
"d3-hierarchy": "^3.1.2",
|
||||
"d3-sankey": "^0.12.3",
|
||||
"daisyui": "^4.12.23",
|
||||
"daisyui": "^4.12.24",
|
||||
"date-fns": "^3.6.0",
|
||||
"date-fns-tz": "^3.1.3",
|
||||
"date-picker-svelte": "^2.12.0",
|
||||
|
||||
@ -163,14 +163,16 @@ export const groupEarnings = (earnings) => {
|
||||
return Object?.entries(
|
||||
earnings
|
||||
?.reduce((acc, item) => {
|
||||
const dateKey = new Intl.DateTimeFormat('en-US', {
|
||||
const date = new Date(item?.date);
|
||||
const berlinDate = new Intl.DateTimeFormat('en-US', {
|
||||
day: '2-digit',
|
||||
month: 'short',
|
||||
year: 'numeric',
|
||||
}).format(new Date(item?.date));
|
||||
timeZone: 'Europe/Berlin'
|
||||
}).format(date);
|
||||
|
||||
if (!acc[dateKey]) acc[dateKey] = [];
|
||||
acc[dateKey]?.push(item);
|
||||
if (!acc[berlinDate]) acc[berlinDate] = [];
|
||||
acc[berlinDate]?.push(item);
|
||||
return acc;
|
||||
}, {})
|
||||
)
|
||||
@ -180,14 +182,19 @@ export const groupEarnings = (earnings) => {
|
||||
date,
|
||||
// Sort earnings within the date by time
|
||||
earnings?.sort((a, b) => {
|
||||
const timeA = new Date(`1970-01-01T${a?.time}`);
|
||||
const timeB = new Date(`1970-01-01T${b?.time}`);
|
||||
return timeB - timeA;
|
||||
const berlinTimeA = new Date(
|
||||
new Date(`${item.date}T${a?.time}`).toLocaleString('en-US', { timeZone: 'Europe/Berlin' })
|
||||
);
|
||||
const berlinTimeB = new Date(
|
||||
new Date(`${item.date}T${b?.time}`).toLocaleString('en-US', { timeZone: 'Europe/Berlin' })
|
||||
);
|
||||
return berlinTimeB - berlinTimeA;
|
||||
})
|
||||
]);
|
||||
};
|
||||
|
||||
|
||||
|
||||
export const groupNews = (news, watchList) => {
|
||||
return Object.entries(
|
||||
news
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { screenWidth, numberOfUnreadNotification, isOpen } from "$lib/store";
|
||||
import { screenWidth, isOpen } from "$lib/store";
|
||||
import {
|
||||
groupNews,
|
||||
groupEarnings,
|
||||
@ -7,6 +7,7 @@
|
||||
formatTime,
|
||||
abbreviateNumber,
|
||||
calculateChange,
|
||||
removeCompanyStrings,
|
||||
} from "$lib/utils";
|
||||
import toast from "svelte-french-toast";
|
||||
import { onMount, onDestroy, afterUpdate } from "svelte";
|
||||
@ -500,7 +501,7 @@
|
||||
groupedEarnings = groupEarnings(earnings);
|
||||
} else {
|
||||
groupedEarnings = [];
|
||||
groupedEarnings = [];
|
||||
groupedNews = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1818,7 +1819,7 @@
|
||||
class="flex-grow px-3 py-2 lg:py-1 border-t border-gray-700"
|
||||
>
|
||||
<div>
|
||||
<strong>{item?.name}</strong>
|
||||
{removeCompanyStrings(item?.name)}
|
||||
(<HoverStockChart symbol={item?.symbol} />)
|
||||
will report
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user