MCPcopy Create free account
hub / github.com/simstudioai/sim / parseDateFilter

Function parseDateFilter

apps/sim/connectors/granola/granola.ts:132–139  ·  view source on GitHub ↗

* Parses an optional ISO 8601 date filter from a named source-config field. * Returns a normalized ISO 8601 string when the value is a valid date; otherwise * returns undefined so the request is not scoped to an invalid date.

(sourceConfig: Record<string, unknown>, key: string)

Source from the content-addressed store, hash-verified

130 * returns undefined so the request is not scoped to an invalid date.
131 */
132function parseDateFilter(sourceConfig: Record<string, unknown>, key: string): string | undefined {
133 const raw = sourceConfig[key]
134 if (typeof raw !== 'string') return undefined
135 const trimmed = raw.trim()
136 if (!trimmed) return undefined
137 const parsed = new Date(trimmed)
138 return Number.isNaN(parsed.getTime()) ? undefined : parsed.toISOString()
139}
140
141/**
142 * Detects whether a string contains HTML markup. Granola returns markdown for

Callers 1

granola.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected