Logseq as a Journal app

Is there no similar app that sorts the days from top to bottom like it does as if you are keeping a diary with every block indicating the time? This is the way the journal is ordered right now:

Day 3

11am woke up but feel bad
etc…

Day 2

9am wake up
13pm eat
21pm drink wine

Day 1

9am wake up
13pm eat
21pm sleep

As jou can see it is a bit obfusticated if you use it to try to evaluate trends of, in my case, medication that I am using at certain dosis for leukemia. I realise this is not why everyone uses Logseq and some might prefer having the newest day at the top even if that does not conform to over all chronology if used like in my case. Please I beg you to create an option to have the Journal order ascending or descending by day according to the user’s preference. It would mean the world to me. Is there another app that already makes journaling this easy though?

I have looked at the code that populates the journal timeline by checking if there are days available but have yet been unable to sort it the way I want it due to my lack of Conjure knowledge (I have literally never used it before). Might there be a plugin or css style that might achieve this.
The other option is to remap my ENTER key to create a block Above instead of BELOW each time I hit it. But that would mess up how regular pages work, and would be tricky to do with nested blockes. Some have seggested that I created queries to create the effect. But queries are not the answer I think you will aggree.

Others have tried soft and hard symlinks and filerenaming batch scripts. My guess is that javascript might be the key, but I do not know JS

If someone could give me a simple ts or js file to get started with I will be most appreciative.

Love you. Bye

Here is a workaround:

  • Put the following code in file custom.js (create inside folder logseq if missing):
    document.addEventListener('keyup', (e)=>{    
        if (e.altKey && e.key === "s") {
            const divJournals = document.querySelector("#journals")
            if (!divJournals) return
    
            const journals = divJournals.querySelectorAll("div.journal-item")
            const arr = Array.prototype.map.call(journals, (j)=>j )
            arr.sort( (a, b)=>{
                const aname = a.querySelector(".journal-title h1").textContent
                const bname = b.querySelector(".journal-title h1").textContent
                return aname.localeCompare(bname)            
            })
            divJournals.querySelector("div").prepend(...arr)
        }
    });
    
  • Go to SettingsEditor and set the Preferred date format to: yyyy/mm/dd
  • Press Alt + s to sort the loaded journals from top to bottom
    • Repeat when more journals are loaded
      • That could be by scrolling, pressing End etc.
1 Like