Skip to content

Commit

Permalink
chore(core): add release tags to RelativeTime
Browse files Browse the repository at this point in the history
  • Loading branch information
ricokahler committed Nov 1, 2023
1 parent 442eac0 commit 7db1404
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/sanity/src/core/components/RelativeTime.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import React from 'react'
import {type RelativeTimeOptions, useRelativeTime} from '../hooks/useRelativeTime'

/**
* @internal
*/
export interface RelativeTimeProps extends RelativeTimeOptions {
time: string | Date
}

/**
* @internal
*/
export function RelativeTime({time, ...options}: RelativeTimeProps) {
const timestamp = time instanceof Date ? time : new Date(time)
const timeAgo = useRelativeTime(timestamp, options)
Expand Down

0 comments on commit 7db1404

Please sign in to comment.