mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-10-30 18:22:59 +00:00
- Added valid date prop (1 hour ago) to both default and new-york variants - Fixes RangeError during static export prerendering - Demo now shows working relative time display
13 lines
343 B
TypeScript
13 lines
343 B
TypeScript
import { RelativeTime } from "@/registry/default/ui/relative-time"
|
|
|
|
export default function RelativeTimeDemo() {
|
|
// Example: 1 hour ago
|
|
const oneHourAgo = new Date(Date.now() - 60 * 60 * 1000)
|
|
|
|
return (
|
|
<div className="w-full min-h-[400px] flex items-center justify-center">
|
|
<RelativeTime date={oneHourAgo} />
|
|
</div>
|
|
)
|
|
}
|