export function getMondayBefore()

in src/common/IterationLookup.ts [179:189]


export function getMondayBefore(date: DateTime | Date | string): DateTime {
  if (typeof date === "string") {
    date = DateTime.fromISO(date);
  }
  if (date instanceof Date) {
    date = DateTime.fromJSDate(date);
  }
  const { weekday } = date;
  if (weekday === 1) return date;
  return date.minus({ days: weekday - 1 });
}