fix timezone
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import { useSearchParams } from 'react-router'
|
||||
import { ChevronRightIcon, ChevronLeftIcon } from 'lucide-react'
|
||||
import { subMonths, addMonths } from 'date-fns'
|
||||
import { DateTime } from 'luxon'
|
||||
|
||||
import { Button } from '@repo/ui/components/ui/button'
|
||||
import { ButtonGroup } from '@repo/ui/components/ui/button-group'
|
||||
import { Badge } from '@repo/ui/components/ui/badge'
|
||||
|
||||
import { formatDate, billingPeriod } from './util'
|
||||
import { useSearchParams } from 'react-router'
|
||||
import { tz } from './data'
|
||||
|
||||
type RangePeriodProps = {
|
||||
startDate: Date
|
||||
@@ -19,7 +21,7 @@ export function RangePeriod({
|
||||
endDate,
|
||||
billingDay
|
||||
}: RangePeriodProps) {
|
||||
const today = new Date()
|
||||
const today = DateTime.now().setZone(tz).toJSDate()
|
||||
const [, setSearchParams] = useSearchParams()
|
||||
const prevPeriod = billingPeriod(billingDay, subMonths(startDate, 1))
|
||||
const nextPeriod = billingPeriod(billingDay, addMonths(startDate, 1))
|
||||
|
||||
Reference in New Issue
Block a user