feat: Enhance AccountSummary and TransactionTable components with refresh functionality and improve loading/empty states

This commit is contained in:
GitHub Copilot
2025-04-24 16:45:46 -04:00
parent 2cb3bdf117
commit 124b97a397
4 changed files with 82 additions and 59 deletions

View File

@@ -45,10 +45,10 @@ export default function AddTransactionForm({}: AddTransactionFormProps) {
const dateObj = new Date(transactionToEdit.date);
// Check if date is valid before formatting
if (!isNaN(dateObj.getTime())) {
// Adjust for timezone offset to prevent date shifting
const timezoneOffset = dateObj.getTimezoneOffset() * 60000; //offset in milliseconds
const adjustedDate = new Date(dateObj.getTime() - timezoneOffset);
setDate(adjustedDate.toISOString().split("T")[0]);
// Directly format the date object (usually interpreted as UTC midnight)
// into the YYYY-MM-DD format required by the input.
// No timezone adjustment needed here.
setDate(dateObj.toISOString().split("T")[0]);
} else {
console.warn(
"Invalid date received for editing:",