Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

633 B
Raw Blame
/**
 * The days a card of another chat names under its head: one day, a span, or
 * that it has none yet. Pure, so the trip's card and the journal's read one
 * wording.
 */
export function chatDates(
  t: (key: string, params?: Record<string, string>) => string,
  date: (value: string) => string,
  startDate: string | null,
  endDate: string | null
): string {
  const start = startDate ?? endDate;
  const end = endDate ?? startDate;
  if (!start || !end) return t('assistant.card.tripChat.noDates');
  if (start === end) return date(start);
  return t('assistant.card.tripChat.dates', { start: date(start), end: date(end) });
}