Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

246 B
Raw Blame
import { dayjs } from "metabase/dayjs";

export function getDateDisplay(date: string) {
  const dateObj = dayjs(date);
  const dayDiff = dayjs().diff(dateObj, "days");

  return dayDiff > 30 ? dateObj.format("MMM D, YYYY") : dateObj.fromNow();
}