I have this problem. I have this vector with two fields for position:
fecha: 9/10/2017
turno: 0
fecha: 9/10/2017
turno: 6
fecha: 9/10/2017
turno: 17
fecha: 10/10/2017
turno: 17
And for order this I am using this code:
self.TodasMisCitas.sort {
if ($0.fecha as Date == $1.fecha as Date) {
return ($0.turno) > ($1.turno)
}
return ($0.fecha) > ($1.fecha)
}
This is the output:
The correct output for me will be:
martes 10/10/2017
lunes 09/10/2017 a las 10:00
lunes 09/10/2017 a las 11:30
lunes 09/10/2017 a las 16:00
Anybody know what's happening?