update
This commit is contained in:
@ -5,11 +5,6 @@ import { useCallback, useEffect, useState } from 'react';
|
|||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { DateRangePicker } from '@/pages/dashboards/home/blocks';
|
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 formatDate = (date: Date): string => date.toISOString().split('T')[0];
|
||||||
|
|
||||||
const ListToolBar = () => {
|
const ListToolBar = () => {
|
||||||
@ -68,6 +63,15 @@ const ListToolBar = () => {
|
|||||||
}, 0);
|
}, 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(() => {
|
useEffect(() => {
|
||||||
const checkNewDay = () => {
|
const checkNewDay = () => {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
|||||||
Reference in New Issue
Block a user