Forum Academy Marketplace Showcase Pricing Features

Date range sorting

Hello,
I am not really sure if it is a bug or not but sorting using a date range field seems wrong to me.
I do a search for items that have a Date range field (for instance a hotel reservation period) and I want to display them sorted in a comprehensible way for the user.
The most intuitive to me would be to sort them for instance regarding the start date of the date range, so that reservations that happen first in time will appear first in the list.

I couldn’t find a way to explicitly sort using the start or end date of the date range field.
Is that possible ?

The only way I see it would be to switch back to a date for the start, and a date for the end of the period, but that would make the new Date Range type quite limited I think…

Thanks

Edit:
Looking at the following documentation of the Date Range type:

 is after
Returns yes if the both values of the range are greater than the ones of the argument.

is after (point)
Returns yes if the both values of the range are greater than the argument (date or number).

is before
Returns yes if the both values of the range are smaller than the ones of the argument.

is before (point)
Returns yes if the both values of the range are smaller than the argument.

I guess that non-overlapping can be sorted, but overlapping date ranges cannot.
Indeed, for overlapping ranges, is after would return false, and is before would return false as well.
Maybe the overlapping case should be handled in some way

This topic was automatically closed after 14 days. New replies are no longer allowed.