Skip to content

Commit

Permalink
Add chat counts to chart header (#323)
Browse files Browse the repository at this point in the history
* Implement

* Clean up
  • Loading branch information
IgorKrupenja authored Oct 24, 2024
1 parent 814e22f commit 98fb29a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions GUI/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"@types/howler": "^2.2.11",
"@types/react-datepicker": "^4.8.0",
"@vitejs/plugin-react": "^3.0.0",
"prettier": "^3.3.3",
"vite": "^4.5.2",
"vite-plugin-env-compatible": "^1.1.1",
"vite-plugin-svgr": "^2.4.0",
Expand Down
9 changes: 8 additions & 1 deletion GUI/src/components/MetricsCharts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ const MetricsCharts = ({ title, data, startDate, endDate, unit, groupByPeriod }:
header={
<div className="container">
<div className="title">
<h3>{t(title)}</h3>
<h3>
{t(title)}{' '}
{startDate !== endDate
? `${formatTimestamp(startDate)} - ${formatTimestamp(endDate)}`
: formatTimestamp(startDate)}
</h3>
</div>
<div className="other_content">
<Button
Expand Down Expand Up @@ -135,3 +140,5 @@ const MetricsCharts = ({ title, data, startDate, endDate, unit, groupByPeriod }:
};

export default MetricsCharts;

const formatTimestamp = (timestamp: string) => formatDate(new Date(timestamp), 'dd.MM.yyyy');

0 comments on commit 98fb29a

Please sign in to comment.