Skip to content

Commit

Permalink
Merge pull request #1346 from openedx/eahmadjaved/ENT-9705-2
Browse files Browse the repository at this point in the history
fix: resolve some issue on analytics v2
  • Loading branch information
jajjibhai008 authored Nov 13, 2024
2 parents ba8fc56 + 149f4e1 commit dd5c77d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/components/AdvanceAnalyticsV2/AnalyticsV2Page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ const AnalyticsV2Page = ({ enterpriseId }) => {
endDate,
});
const currentDate = new Date().toISOString().split('T')[0];
const formatDate = (dateString) => {
const options = { year: 'numeric', month: 'long', day: 'numeric' };
return new Date(dateString).toLocaleDateString(undefined, options);
};
return (
<>
<Helmet title={PAGE_TITLE} />
Expand All @@ -43,7 +47,7 @@ const AnalyticsV2Page = ({ enterpriseId }) => {
id="advance.analytics.data.refresh.msg"
defaultMessage="Data updated on {date}"
description="Data refresh message"
values={{ date: data?.lastUpdatedAt || currentDate }}
values={{ date: formatDate(data?.lastUpdatedAt || currentDate) }}
/>
</span>
</div>
Expand Down Expand Up @@ -191,6 +195,7 @@ const AnalyticsV2Page = ({ enterpriseId }) => {
<div className="tabs-container">
<Tabs
variant="tabs"
className="d-flex justify-content-between px-2"
activeKey={activeTab}
onSelect={(tab) => {
setActiveTab(tab);
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdvanceAnalyticsV2/tabs/AnalyticsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const AnalyticsTable = ({
title={tableTitle}
subtitle={tableSubtitle}
DownloadCSVComponent={(
<Link to={CSVDownloadURL} target="_blank" className="btn btn-sm btn-outline-primary ml-0 ml-md-3 mr-3">
<Link to={CSVDownloadURL} target="_blank" className="btn btn-sm btn-primary float-right">
<Icon src={Download} className="mr-2" />
<FormattedMessage
id="adminPortal.AnalyticsV2.downloadCSV.button"
Expand Down

0 comments on commit dd5c77d

Please sign in to comment.