update range period
This commit is contained in:
@@ -19,6 +19,7 @@ export function RangePeriod({
|
||||
endDate,
|
||||
billingDay
|
||||
}: RangePeriodProps) {
|
||||
const today = new Date()
|
||||
const [, setSearchParams] = useSearchParams()
|
||||
const prevPeriod = billingPeriod(billingDay, subMonths(startDate, 1))
|
||||
const nextPeriod = billingPeriod(billingDay, addMonths(startDate, 1))
|
||||
@@ -57,7 +58,7 @@ export function RangePeriod({
|
||||
<Button
|
||||
variant="outline"
|
||||
className="border-dashed cursor-pointer"
|
||||
disabled={nextDate > new Date()}
|
||||
disabled={nextDate > today}
|
||||
onClick={() => {
|
||||
setSearchParams((searchParams) => {
|
||||
const [start, end] = nextPeriod
|
||||
|
||||
Reference in New Issue
Block a user