Help with sorting a "german" date format in BASE

What I’m trying to do

I am using Daily Notes in Obsidian. The filename is the date, formatted like DD.MM.YYYY
I am struggling with getting things sorted correctly in BASE views. I would like to have files displayed with todays file being the first one and then descending. No matter if the files have been modified since their creation or not.
What would be the best way to achieve this?
Thanks for some advice.

Wolfgang

Hello.

I don’t know how to do what you want to do, but the link below talks about slicing German dates to reformat them. Hoping this might help you a little:

Hi, again.

The code below seems to work in a local test vault:

```base
formulas:
  Untitled: date(file.name.slice(6,10)+'-'+file.name.slice(3,5)+'-'+file.name.slice(0,2))
properties:
  formula.Untitled:
    displayName: sortdate
views:
  - type: table
    name: Table
    filters:
      and:
        - file.folder == "daily notes"
    order:
      - file.name
      - formula.Untitled
    sort:
      - property: formula.Untitled
        direction: ASC
    columnSize:
      file.name: 122

```

Thanks a lot for this. I will give it a try. I did assume already that the german date format is not really suitable for proper sorting purposes… :wink:

Works smoothly!! Thanks a lot again :grinning_face:

1 Like