GetDateRange
cartographer / getDateRange
Function: getDateRange()
Section titled “Function: 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.
Parameters
Section titled “Parameters”Array of items to analyze
fieldKey
Section titled “fieldKey”string
Date field key to analyze
Returns
Section titled “Returns”[Date, Date] | null
- [minDate, maxDate] tuple or null if no valid dates found
Example
Section titled “Example”const [first, last] = getDateRange(items, 'date-read') || [null, null];