MCPcopy Create free account
hub / github.com/dailydotdev/apps / getIntelWeekLabel

Function getIntelWeekLabel

packages/shared/src/features/squads/lib/intel.ts:45–61  ·  view source on GitHub ↗
({
  weekStart,
  weekEnd,
}: {
  weekStart: string;
  weekEnd: string;
})

Source from the content-addressed store, hash-verified

43// "Oct 26 to Nov 1": the week ends the Monday after, so the last day is the
44// Sunday before it
45export const getIntelWeekLabel = ({
46 weekStart,
47 weekEnd,
48}: {
49 weekStart: string;
50 weekEnd: string;
51}): string => {
52 const format = (date: Date) =>
53 date.toLocaleDateString('en-US', {
54 month: 'short',
55 day: 'numeric',
56 timeZone: 'UTC',
57 });
58 const lastDay = new Date(new Date(weekEnd).getTime() - 24 * 60 * 60 * 1000);
59
60 return `${format(new Date(weekStart))} to ${format(lastDay)}`;
61};

Callers 2

renderContentFunction · 0.90
LatestIntelFunction · 0.90

Calls 1

formatFunction · 0.85

Tested by

no test coverage detected