How do you sort a list of lists by date?

Buen día comunidad
quisiera saber si esta extensión me servirá para ordenar por fechas
cuento con esto en el firebase
image

actualmente obtengo esto con el ejemplo
2 ordenar una lista de acuerdo con el segundo elemento
y como se puede apreciar no lo ordena
image

y quisiera quisiera obtenerlo en la aplicación de la siguiente manera de mayor a menor
image

saludos

No, there is no longer a need for sort extensions.

Use this block
lists_sort_comparator
And code your own comparison test.

I see you chose a most unfortunate date format in your data base, dd-MM-yyyy,
that requires a shuffling of its parts before it can be sorted chronologically.

yyyy-MM-dd is better for that.

intente con esto y no me ordena
image
image
para recalcar que los últimos números son fechas dd MM yyyy

¿tendrás algún ejemplo?

Can you translate your blocks to English?


TRADUCIDO

Now show us what is in that global evita_repetir using the Do It facility.

On further inspection, I see that you used a '-' math block instead of a '>' text comparison block in the sort block.

You also did not rearrange any date parts to get chronological ordering.

las fechas lo obtengo del firebase
Etiqueta: Valor

image

estos son mis bloques



obtengo esto
image
como se ve no esta ordenado

That csv has way too may quotes.

Test the length of list of each row and report back.

I missed the colon : between key and value in the Firebase console.

That means the structure that arrived was a dictionary, and not a table.
That list sort block might not know how to work with dictionaries.

Look in the list and dictionary blocks pallette for a block that can convert a dictionary into a table (list of lists).

Feed the converted table into the list sort block.

dictionaries_dict_to_alist

Try this, and see if the output can be sorted.

P.S. It works:

The conversion is necessary:

perfecto


si lo ordeno de mayor a menor
image

por ultimo
quisiera obtener en otro lavel
solo parte de la primera fila como ítem no como recortar texto
de:
20230519-10002,2024 05 08
a:
2024 05 08

saludos

Work only from the global sorted table, not from encrusted text.

The value you want is in item 2 of item 1 of that table.

como haría para llegar a ese punto


ya intente en varias formar

perfecto
te lo agradezco ABG
saludos

Oops, I forgot the dict to list of pairs conversion before the sort.
A moment ...

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