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 authored and rexxars committed Nov 3, 2023
1 parent 4601245 commit b6f880e
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 b6f880e

Please sign in to comment.