Order by year instead of date


Is it possible to just order by year instead of the whole date.

Currently I am using



see date resolution part:

This seems to be the date range queries but how to sort the results just by year instead of the complete date?
For example, if the publish date in the articles is 2019-05-06 then sort by just YYYY in that field.
The reason is, I want my articles to be sorted based on year and title. I don’t want them to be sorted based on the complete date and title.

Can you try this?

import org.hippoecm.repository.util.DateTools;
import org.hippoecm.repository.util.DateTools.Resolution;

.orderByDescending(DateTools.getPropertyForResolution("hippostdpubwf:publicationDate", Resolution.YEAR));

That worked. Thanks a ton!