change template of disbursement .xlsx

This commit is contained in:
bagusajisaputroo
2025-05-18 03:13:22 +07:00
parent 665922aec5
commit c1afae4bff
2 changed files with 3 additions and 6 deletions

View File

@ -9,23 +9,20 @@ const ListToolbar = () => {
const { table, reload } = useDataGrid();
const { handleUploadBatchDialog } = useTransactionContext();
// Set the initial state for trxDate
const [trxDate, settrxDate] = useState({ from: '', to: '' });
// Function to format date to YYYY-MM-DD
const formatDate = (date: Date): string => {
return date.toISOString().split('T')[0];
};
// useEffect to set the default date values
useEffect(() => {
const today = new Date();
const nextWeek = new Date(today);
nextWeek.setDate(today.getDate() + 7);
settrxDate({
from: formatDate(today), // Set 'from' to today
to: formatDate(nextWeek) // Set 'to' to 7 days later
from: formatDate(today),
to: formatDate(nextWeek)
});
}, []);
@ -40,7 +37,7 @@ const ListToolbar = () => {
const handleExportData = () => {
const link = document.createElement('a');
link.href = toAbsoluteUrl('/media/file-templates/batch-sample.xlsx');
link.href = toAbsoluteUrl('/media/file-templates/template-of-upload-batch.xlsx');
link.download = 'upload-batch-template.xlsx';
document.body.appendChild(link);
link.click();