Add sort order parameter
Author: micahellisonCreated Jan 25, 2020Updated May 19, 2025
Labelsenhancement:pushpin:
Currently, jrnl only outputs in ascending order. Adding a sort feature would allow for lots more flexibility in recipes and perhaps the export functionality as well. For instance, being able to get the date of the earliest (rather than latest) entry that matches a particular search would help with a recipe for #818.
There are lots of different ways this go, however, and I'd love to here anyone's thoughts on the best approach:
- it could only sort the output
- it could only affect the -n argument behavior
- it could affect the output and -n at the same time
- there could be separate arguments for display order vs. search order
- there could be an argument for display order, then an additional argument that's like -n except it's always working in ascending
Looks like part of this issue was brought up in #396, but it staled out. I think whatever the consensus is, we'll want to carefully measure its impact on the rest of the functionality, since this affects everything from display to editing to exporting to future recipes.
Source: jrnl-org/jrnl