diff --git a/src/App.jsx b/src/App.jsx
index 18fb965..4b4536c 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -28,7 +28,7 @@ const router = createBrowserRouter([
errorElement: ,
},
{
- path: "/stats",
+ path: "stats",
element: ,
errorElement: ,
},
diff --git a/src/components/ExpenseItem.jsx b/src/components/ExpenseItem.jsx
index 003d83f..895ce87 100644
--- a/src/components/ExpenseItem.jsx
+++ b/src/components/ExpenseItem.jsx
@@ -1,10 +1,6 @@
import { Link, useFetcher } from "react-router-dom";
import { FiXCircle } from "react-icons/fi";
-import {
- formatCurrency,
- formatDateToLocaleString,
- getAllMatchingItems,
-} from "../helpers";
+import { formatCurrency, getAllMatchingItems, formatDate } from "../helpers";
const ExpenseItem = ({ expense, showBudget }) => {
const fetcher = useFetcher();
@@ -22,17 +18,11 @@ const ExpenseItem = ({ expense, showBudget }) => {
{formatCurrency(expense.amount)}
- {formatDateToLocaleString(expense.createdAt)}
+ {formatDate(expense.createdAt)}
|
{showBudget && (
-
- {budget.name}
-
+ {budget.name}
|
)}
diff --git a/src/helpers.js b/src/helpers.js
index b887972..f183127 100644
--- a/src/helpers.js
+++ b/src/helpers.js
@@ -72,6 +72,7 @@ export const calculateSpentByBudget = (budgetId) => {
};
export const formatDateToLocaleString = (epoch) => new Date(epoch).toLocaleDateString();
+export const formatDate = (epoch) => epoch.replace(/-/g, "/");
export const formatPercentage = (amt) => {
return amt.toLocaleString(undefined, {
|