[plone.app.querystring/Collection] "within last N days" translated to "largerThanRelativeDate"

Plone 5.2.1

Creating a collection criteria with effective date "with last" 365 days is stored internally as

[{'i': 'effective', 'o': 'plone.app.querystring.operation.date.largerThanRelativeDate', 'v': '365'}]

which seems incorrect. The stored query sounds like 365 days in the future.

Looks as if something is mixing up future and past in the criteria UI here!?

Sidenote: within a migration we transform an old-style date criterion with operation less into lessThanRelativeDate (using Plone's own migration code for topics).

It can be bit confusing:

We're filtering on dates here, where the effective date needs to be larger then the date relative to the current date - the number of days given.
Granted, it probably would have been better if it would store -365, but then you'd need to convert it in the frontend to make it displayable for the user.

note: I typed this in myself back in the day and it hurt my brain.

Plone Foundation Code of Conduct