change template of disbursement .xlsx
This commit is contained in:
BIN
public/media/file-templates/template-of-upload-batch.xlsx
Normal file
BIN
public/media/file-templates/template-of-upload-batch.xlsx
Normal file
Binary file not shown.
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user