- Issue created by @tostinni
- Merge request !5Check if a field contains a date only and adjust the calculation to consider... → (Open) created by tostinni
The sort coded in the module assume that the field has a time and adjust if using timezone offset.
This will work fine for those fields, but when we're sorting on a date only field, then the node will be considered in the past at the first hour of the day.
Add a date only field and use future/past date sort on it.
If you examine the SQL query produced you will see something like this (assuming a GMT +1 time zone) :
UNIX_TIMESTAMP() > UNIX_TIMESTAMP(node__field_date.field_date_value) - 3600 AS "in_past"
The problem is that UNIX_TIMESTAMP(node__field_date.field_date_value)
will retrieve the timestamp for the date at 00h00 and automatically the current day will be considered in the past.
MR to be contributed.
Active
1.0
Code