Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chat counts to chart header #323

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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');