mirror of
https://github.com/acedanger/finance.git
synced 2025-12-05 22:50:12 -08:00
feat: Enhance AccountSummary and TransactionTable components with refresh functionality and improve loading/empty states
This commit is contained in:
@@ -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:",
|
||||
|
||||
Reference in New Issue
Block a user