Creates a comparator function for date-based sorting with automatic string
parsing.
Generates a comparator that extracts date values from objects,
automatically converting string representations to Date objects for
numerical comparison. Supports both single dates and arrays of dates for
complex temporal sorting.
Date strings are parsed using the standard Date constructor, which supports
ISO 8601 format, RFC 2822 format, and other common date representations.
The comparison is performed on millisecond timestamps for precise
ordering.
Creates a comparator function for date-based sorting with automatic string parsing.
Generates a comparator that extracts date values from objects, automatically converting string representations to Date objects for numerical comparison. Supports both single dates and arrays of dates for complex temporal sorting.
Date strings are parsed using the standard Date constructor, which supports ISO 8601 format, RFC 2822 format, and other common date representations. The comparison is performed on millisecond timestamps for precise ordering.
Example