This commit is contained in:
zadit
2025-01-27 07:14:48 +07:00
parent f1591b1a2a
commit 54a45e35c2
4 changed files with 147 additions and 37 deletions

View File

@@ -22,6 +22,7 @@
justify-content: space-around;
position: relative;
overflow: hidden;
font-size: 14px;
}
.dateSelector {

View File

@@ -59,17 +59,21 @@ const DailyCharts = ({ transactionGraph, colors, type }) => {
0
);
const formatDate = (dateString) => {
const date = new Date(dateString);
const monthNames = [
"Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agu", "Sep", "Okt", "Nov", "Des"
];
const month = monthNames[date.getUTCMonth()]; // Use getUTCMonth() for UTC month
const day = date.getUTCDate(); // Use getUTCDate() for UTC day
return { month, day };
};
const formatDate = (dateString) => {
const date = new Date(dateString); // Parse the date string
// Create an array of month names (use the same names you had earlier)
const monthNames = [
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
];
// Get the month and day
const month = monthNames[date.getMonth()]; // Month is 0-indexed (January = 0)
const day = date.getDate(); // Get the day of the month
return { month, day }; // Return the result
};
return (
<div className={styles.chartItemContainer}>
{chartData &&