function formatDate()

in src/content/components/BugList/columnTransforms.js [24:37]


function formatDate(value, monthAndYear = false) {
  const now = DateTime.local();
  const t = DateTime.fromISO(value).setZone();
  if (monthAndYear) {
    return t.toFormat("MMM yyyy");
  }
  if (t.hasSame(now, "day")) {
    return t.toFormat("t");
  }
  if (!t.hasSame(now, "year")) {
    return t.toFormat("MMM d yyyy");
  }
  return t.toFormat("ccc MMM d");
}