mirror of
https://github.com/tiennm99/exchange-rate-export.git
synced 2026-10-11 03:13:21 +00:00
fix: a day off on input
This commit is contained in:
1 parent
3915f6231e
commit
bf9bd07ad2
2 files changed
+4
-4
No files matched your search
@@ -105,7 +105,7 @@ export async function POST(request) {
|
||||
{ status: 400, headers: { "Content-Type": "application/json" } }
|
||||
);
|
||||
}
|
||||
const dates = getDateRange(new Date(startDate), new Date(endDate));
|
||||
const dates = getDateRange(startDate, endDate);
|
||||
const results = [];
|
||||
for (const date of dates) {
|
||||
let rate = null;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import React, { useState } from "react";
|
||||
import DatePicker from "react-datepicker";
|
||||
import "react-datepicker/dist/react-datepicker.css";
|
||||
import { parse, isDate } from "date-fns";
|
||||
import { parse, isDate, format } from "date-fns";
|
||||
|
||||
export default function ExchangeRateViewer({
|
||||
defaultStartDate,
|
||||
@@ -52,8 +52,8 @@ export default function ExchangeRateViewer({
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
startDate: start.toISOString().split("T")[0],
|
||||
endDate: end.toISOString().split("T")[0],
|
||||
startDate: format(start, 'yyyy-MM-dd'),
|
||||
endDate: format(end, 'yyyy-MM-dd'),
|
||||
bank: selectedBank,
|
||||
}),
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user