Problems sorting a list

Hello, I have a list with entries in this format:

“20.07.2020 um 18:00 Uhr Beispieltext”

I would like to sort this list. The most recent entry should be at the top. I tried the “List Addon” extension. The “Bubble Sort” module would have been the best for me here. However, this does not work because it can only process lists with numbers. However, my entries contain numbers and text. Are there any other ways to sort my list? I thank you in advance for your help.

  1. I don’t see a list. So what are the items in the list?
  2. Show the relevant blocks.
  3. What should the result be after sorting? Example.

Here is an example list:
19.07.2020 um 14:30 Uhr Beispieltext
20.07.2020 um 16:00 Uhr Beispieltext
23.07.2020 um 17:30 Uhr Beispieltext
20.07.2020 um 18:00 Uhr Beispieltext

This is how it should look after sorting:
23.07.2020 um 17:30 Uhr Beispieltext
20.07.2020 um 18:00 Uhr Beispieltext
20.07.2020 um 16:00 Uhr Beispieltext
19.06.2020 um 14:30 Uhr Beispieltext

2 Likes

Thank you very much, I will try later. I then report the result.

a probably better example list to test would be
19.07.2020 um 14:30 Uhr Beispieltext
20.06.2020 um 16:00 Uhr Beispieltext
23.07.2020 um 17:30 Uhr Beispieltext
20.07.2019 um 18:00 Uhr Beispieltext

:wink:
Taifun

1 Like

Unfortunately there is still a problem. The list is sorted by the day. However, the list would first have to be sorted by month and then by day. Is there a solution for this too?!

That’s right, that was a mistake on my part. There are still problems with the sorting of the months.

Yes, that’s a little tricky if the sorting is to be done on the date (not day).

I converted the date to millis and did the sorting with it, and then removed the millis again from the list items.

1 Like

store your data in format YYYY-MM-DD HH:MM to be able to sort easily
and for the user convert it into the format your prefer

Taifun

1 Like

Thank you for your help and the great effort for you. The solution is really complex for me and I have to try to implement it first. I will write to you if I have made it or if there are any problems.

Everything works without problems. It is nice that everyone is helped here, no matter how extensive the problem. :+1:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.