Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

486 B
Raw Blame
import { utc } from '@date-fns/utc';
import { format, parseISO } from 'date-fns';

/** Calendar dates from the overview are already local `YYYY-MM-DD`. Treat them
 *  as UTC so `date-fns` never applies a second viewer time zone. */
export const OVERVIEW_TZ = utc;

export function parseOverviewDate(date: string): Date {
  return utc(parseISO(`${date}T00:00:00Z`));
}

export function formatOverviewDate(date: Date): string {
  return format(date, 'yyyy-MM-dd', { in: OVERVIEW_TZ });
}