MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / title

Function title

apps/webapp/app/components/runs/TimeFrameFilter.tsx:86–110  ·  view source on GitHub ↗
(
  from: number | undefined,
  to: number | undefined,
  relativeTimeSeconds: number | undefined
)

Source from the content-addressed store, hash-verified

84}
85
86function title(
87 from: number | undefined,
88 to: number | undefined,
89 relativeTimeSeconds: number | undefined
90): string {
91 if (!from && !to) {
92 return "All time periods";
93 }
94
95 if (relativeTimeSeconds !== undefined) {
96 return timeFrameValues.find((t) => t.value === relativeTimeSeconds)?.label ?? "Timeframe";
97 }
98
99 let fromString = from ? formatDateTime(new Date(from), "UTC", ["en-US"], false, true) : undefined;
100 let toString = to ? formatDateTime(new Date(to), "UTC", ["en-US"], false, true) : undefined;
101 if (from && !to) {
102 return `From ${fromString} (UTC)`;
103 }
104
105 if (!from && to) {
106 return `To ${toString} (UTC)`;
107 }
108
109 return `${fromString} - ${toString} (UTC)`;
110}
111
112function RelativeTimeFrame({
113 value,

Callers 1

TimeFrameFilterFunction · 0.85

Calls 2

formatDateTimeFunction · 0.90
findMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…