This commit is contained in:
dohsimpson
2025-01-01 23:27:20 -05:00
parent 11ea0ff89e
commit 7afe81ddd5
2 changed files with 10 additions and 5 deletions

View File

@@ -2,6 +2,8 @@
import HeatMap from '@uiw/react-heat-map'
import { Habit } from '@/lib/types'
import { getDateInTimezone } from '@/lib/utils'
import { useSettings } from '@/hooks/useSettings'
interface HabitHeatmapProps {
habits: Habit[]
@@ -24,9 +26,12 @@ export default function HabitHeatmap({ habits }: HabitHeatmapProps) {
count
}))
const { settings } = useSettings()
// Get start date (30 days ago)
const startDate = new Date()
startDate.setDate(startDate.getDate() - 30)
const now = getDateInTimezone(new Date(), settings.system.timezone)
const startDate = now
startDate.setDate(now.getDate() - 30)
return (
<div className="p-4 bg-white rounded-lg shadow">