1
Hello, how do I make the short recognize the whole object
{
"Dir": "Sd:/",
"List": [
{
"Tipo": "P.O.S.-",
"Data": "11/10/2017",
"Hora": "23:58",
"Size": "0",
"Nome": "Arquivo1"
},
{
"Tipo": "P.-.-.-",
"Data": "12/05/2017",
"Hora": "23:57",
"Size": "0",
"Nome": "Arquivo2"
},
{
"Tipo": "P.-.-.A",
"Data": "14/10/2017",
"Hora": "23:57",
"Size": "0",
"Nome": "Arquivo3"
},
{
"Tipo": "P.-.-.-",
"Data": "16/12/2017",
"Hora": "23:57",
"Size": "0",
"Nome": "Arquivo4"
},
{
"Tipo": "P.-.-.-",
"Data": "29/09/2017",
"Hora": "23:57",
"Size": "0",
"Nome": "Arquivo5"
}
],
"NArq": "0",
"NPast": "5"
}
I want to organize the object "Date" in order of last modification.
var a = a.Data.toLowerCase();
var b = b.Data.toLowerCase();
return a < b ? -1 : a > b ? 1 : 0;
It only detects the first number, but not the rest :/
Can you explain better "only detects the first number" and "whole variable"? you’re trying to make
.sort()
by dates?– Sergio
It does not detect the month, only the first digit. I want to organize a list with dates "08/11/2017" in order of last modification
– Stan
And this
a.Data
is an objectDate
or a string in formatdd/mm/aaaa/
?– Sergio
I’ll edit the question to get better
– Stan