update
This commit is contained in:
@ -5,11 +5,6 @@ import { useCallback, useEffect, useState } from 'react';
|
||||
import { toast } from 'sonner';
|
||||
import { DateRangePicker } from '@/pages/dashboards/home/blocks';
|
||||
|
||||
const getOneMonthsAgo = () => {
|
||||
const today = new Date();
|
||||
return new Date(today.getFullYear(), today.getMonth() - 1, today.getDate());
|
||||
};
|
||||
|
||||
const formatDate = (date: Date): string => date.toISOString().split('T')[0];
|
||||
|
||||
const ListToolBar = () => {
|
||||
@ -68,6 +63,15 @@ const ListToolBar = () => {
|
||||
}, 0);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
table.getColumn('created_at')?.setFilterValue(dateRange);
|
||||
} catch (error) {
|
||||
toast.error('Error applying date filter');
|
||||
console.error('Date filter error:', error);
|
||||
}
|
||||
}, [dateRange]);
|
||||
|
||||
useEffect(() => {
|
||||
const checkNewDay = () => {
|
||||
const now = new Date();
|
||||
|
||||
Reference in New Issue
Block a user