reaper47 / recipya

A clean, simple and powerful recipe manager your whole family will enjoy.
https://recipya.musicavis.ca
GNU General Public License v3.0
185 stars 11 forks source link

"Date Created" Sort logic in recipe list seems to be inverted #365

Closed bakker closed 3 months ago

bakker commented 3 months ago

Describe the bug "Date Created" Sort logic in recipe list seems to be inverted, giving oldest recipes first when selecting "Newest to oldest", and giving newest recipes first when selecting "Oldest to newest"

To Reproduce Steps to reproduce the behavior:

  1. Log into Recipya
  2. Add new recipe through your method of choice, just so you're sure it's the newest there ;-)
  3. Sort on either option for "Date Created"
  4. The recipe you just created is the last in the list if you've chosen "Newest to oldest", first in the list if you've chosen "Oldest to newest"

Expected behavior Correct date sorting

Environment

reaper47 commented 3 months ago

Nice catch! In this case, ASC is oldest to newest and DESC newest to oldest. Inverting here should fix it: https://github.com/reaper47/recipya/blob/main/internal%2Fservices%2Fstatements%2Fselect.go#L257-L260

bakker commented 3 months ago

I didn't find the place in code. I'll get you a pull request

bakker commented 3 months ago

366