Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

338 B
Raw Blame
import { formatDistanceToNow } from 'date-fns';

export const ProductPostedDate = async ({
  posted,
}: {
  posted: string | null;
}) => {
  const postedDate = formatDistanceToNow(
    new Date(posted || ''),
    { addSuffix: true }
  );

  return (
    <p className='label-md text-secondary'>
      Posted: {postedDate}
    </p>
  );
};