Skip to content

GetDateRange

cartographer


cartographer / getDateRange

getDateRange(items, fieldKey): [Date, Date] | null

Defined in: queries/queryFunctions.ts:285

Get min and max dates from a date field.

Parses field values as dates and finds the earliest and latest dates.

CatalogItem[]

Array of items to analyze

string

Date field key to analyze

[Date, Date] | null

  • [minDate, maxDate] tuple or null if no valid dates found
const [first, last] = getDateRange(items, 'date-read') || [null, null];