Skip to content

Commit

Permalink
fix: 개근자 목록 csv 저장 시 한글 깨지는 문제 수정 #118
Browse files Browse the repository at this point in the history
  • Loading branch information
Han-Joon-Hyeok committed Dec 29, 2022
1 parent f1091a8 commit 48823b8
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/pages/DashboardPage/MonthlyPerfectUserTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import CardContent from "@mui/material/CardContent";
import Box from "@mui/material/Box";
import {
DataGrid,
GridToolbarContainer,
GridToolbarExport,
GridToolbarExportContainer,
GridCsvExportMenuItem,
} from "@mui/x-data-grid";
import Typography from "@mui/material/Typography";

Expand All @@ -25,22 +25,23 @@ const columns = [
},
];

const csvOptions = { utf8WithBom: true };

function CustomToolbar() {
return (
<GridToolbarContainer>
<GridToolbarExport />
</GridToolbarContainer>
<GridToolbarExportContainer>
<GridCsvExportMenuItem options={csvOptions} />
</GridToolbarExportContainer>
);
}

function MonthlyPerfectUserTable(props) {
const { data } = props;
const rows = [];
if (data.length > 0){
if (data.length > 0) {
data.forEach((user) => {
if (user.isPerfectAttendance)
rows.push(user);
})
if (user.isPerfectAttendance) rows.push(user);
});
}
return (
<Grid item xs={4}>
Expand Down

1 comment on commit 48823b8

@Han-Joon-Hyeok
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.