mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-29 07:34:11 +00:00
fix(www): interactive chart
This commit is contained in:
@@ -18,7 +18,7 @@ export function getRegistryComponent(
|
||||
name: string,
|
||||
style: Style["name"] = DEFAULT_REGISTRY_STYLE
|
||||
) {
|
||||
return memoizedIndex[style][name].component
|
||||
return memoizedIndex[style][name]?.component
|
||||
}
|
||||
|
||||
export async function getRegistryItem(
|
||||
|
||||
@@ -141,15 +141,16 @@ export default function Component() {
|
||||
|
||||
const filteredData = chartData.filter((item) => {
|
||||
const date = new Date(item.date)
|
||||
const now = new Date()
|
||||
const referenceDate = new Date("2024-06-30")
|
||||
let daysToSubtract = 90
|
||||
if (timeRange === "30d") {
|
||||
daysToSubtract = 30
|
||||
} else if (timeRange === "7d") {
|
||||
daysToSubtract = 7
|
||||
}
|
||||
now.setDate(now.getDate() - daysToSubtract)
|
||||
return date >= now
|
||||
const startDate = new Date(referenceDate)
|
||||
startDate.setDate(startDate.getDate() - daysToSubtract)
|
||||
return date >= startDate
|
||||
})
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user