diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/History.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/History.tsx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/History.tsx b/packages/taler-wallet-webextension/src/wallet/History.tsx index 56d0ef7bd..dcc3c43e3 100644 --- a/packages/taler-wallet-webextension/src/wallet/History.tsx +++ b/packages/taler-wallet-webextension/src/wallet/History.tsx @@ -42,6 +42,7 @@ import { Button } from "../mui/Button.js"; import { NoBalanceHelp } from "../popup/NoBalanceHelp.js"; import DownloadIcon from "../svg/download_24px.inline.svg"; import UploadIcon from "../svg/upload_24px.inline.svg"; +import { getDate, startOfDay } from "date-fns"; interface Props { currency?: string; @@ -154,14 +155,14 @@ export function HistoryView({ const datesWithTransaction: string[] = []; const byDate = ts.reduce((rv, x) => { - const theDate = - x.timestamp.t_s === "never" ? 0 : normalizeToDay(x.timestamp.t_s * 1000); - if (theDate) { - if (!rv[theDate]) { - rv[theDate] = []; - datesWithTransaction.push(String(theDate)); + const startDay = + x.timestamp.t_s === "never" ? 0 : startOfDay(x.timestamp.t_s * 1000).getTime(); + if (startDay) { + if (!rv[startDay]) { + rv[startDay] = []; + datesWithTransaction.push(String(startDay)); } - rv[theDate].push(x); + rv[startDay].push(x); } return rv; |