mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
empty date list after emptying calendar list
This commit is contained in:
parent
40b3a16e0f
commit
8921348bbb
@ -733,18 +733,21 @@ export class PollService implements Resolve<Poll> {
|
|||||||
*/
|
*/
|
||||||
convertCalendarToText() {
|
convertCalendarToText() {
|
||||||
console.log('this.dateChoiceList', this.dateChoiceList);
|
console.log('this.dateChoiceList', this.dateChoiceList);
|
||||||
// if(!this.dateChoiceList.length){
|
|
||||||
// return [];
|
|
||||||
// }
|
|
||||||
let converted = [];
|
|
||||||
for (let someDate of this.calendar) {
|
|
||||||
converted.push(this.DateUtilitiesService.convertDateToDateChoiceObject(someDate));
|
|
||||||
}
|
|
||||||
this.dateChoiceList = converted.sort((first: any, second: any) => {
|
|
||||||
return first.date_object - second.date_object;
|
|
||||||
});
|
|
||||||
|
|
||||||
return converted;
|
if (this.calendar && this.calendar.length) {
|
||||||
|
let converted = [];
|
||||||
|
for (let someDate of this.calendar) {
|
||||||
|
converted.push(this.DateUtilitiesService.convertDateToDateChoiceObject(someDate));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.dateChoiceList = converted.sort((first: any, second: any) => {
|
||||||
|
return first.date_object - second.date_object;
|
||||||
|
});
|
||||||
|
return converted;
|
||||||
|
} else {
|
||||||
|
this.dateChoiceList = [];
|
||||||
|
}
|
||||||
|
return this.dateChoiceList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user