<NME> VisitComparator.java
<BEF> package cgeo.geocaching.sorting;

import cgeo.geocaching.models.Geocache;
import cgeo.geocaching.storage.SqlBuilder;
import cgeo.geocaching.utils.CalendarUtils;

import androidx.annotation.NonNull;

/**

    @Override
    protected boolean canCompare(final cgCache cache1, final cgCache cache2) {
        return cache1.getVisitedDate() > 0 && cache2.getVisitedDate() > 0;
    }

    @Override
    protected int compareCaches(final Geocache cache1, final Geocache cache2) {
        return compare(cache2.getVisitedDate(), cache1.getVisitedDate());
    }

    /**
     * copy of Long#compare to avoid boxing
     */
    public static int compare(final long lhs, final long rhs) {
        return Long.compare(lhs, rhs);
    }

    @Override
    public String getSortableSection(@NonNull final Geocache cache) {
        return CalendarUtils.yearMonth(cache.getVisitedDate());
    }

    @Override
    public void addSortToSql(final SqlBuilder sql, final boolean sortDesc) {
        sql.addOrder(sql.getMainTableId() + ".visiteddate", !sortDesc);
    }

}

<MSG> Allow sorting by date logged in lists

<DFF> @@ -10,7 +10,7 @@ public class VisitComparator extends AbstractCacheComparator {
 
     @Override
     protected boolean canCompare(final cgCache cache1, final cgCache cache2) {
-        return cache1.getVisitedDate() > 0 && cache2.getVisitedDate() > 0;
+        return true;
     }
 
     @Override

Allow sorting by date logged in lists