mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
fix sort compare
This commit is contained in:
parent
b1b6ec650a
commit
bf8c6a9b7a
@ -670,7 +670,7 @@ export class PollService implements Resolve<Poll> {
|
|||||||
converted.push(this.DateUtilitiesService.convertDateToDateChoiceObject(someDate));
|
converted.push(this.DateUtilitiesService.convertDateToDateChoiceObject(someDate));
|
||||||
}
|
}
|
||||||
this.dateChoiceList = converted.sort((first: any, second: any) => {
|
this.dateChoiceList = converted.sort((first: any, second: any) => {
|
||||||
return second.date_object < first.date_object;
|
return first.date_object - second.date_object;
|
||||||
});
|
});
|
||||||
|
|
||||||
return converted;
|
return converted;
|
||||||
|
@ -144,8 +144,8 @@ export class DayListComponent {
|
|||||||
this.dateUtilitiesService.addDaysToDate(1, lastDateChoiceObject)
|
this.dateUtilitiesService.addDaysToDate(1, lastDateChoiceObject)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
this.pollService.dateChoiceList = this.pollService.dateChoiceList.sort((a: any, b: any) => {
|
this.pollService.dateChoiceList.sort((a: any, b: any) => {
|
||||||
return b.date_object < a.date_object;
|
return a.date_object - b.date_object;
|
||||||
});
|
});
|
||||||
this.focusOnChoice(this.storageService.dateChoices.length - 1);
|
this.focusOnChoice(this.storageService.dateChoices.length - 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user