Improve aganda

This commit is contained in:
Peter Maquiran
2021-04-14 12:02:43 +01:00
parent 377a29c5f7
commit 8828c319a4
2 changed files with 23 additions and 26 deletions
+21 -18
View File
@@ -863,26 +863,29 @@ export class AgendaPage implements OnInit {
selectFirstEventOfTheDay(){ selectFirstEventOfTheDay(){
setTimeout(()=>{ setTimeout(()=>{
if(this.eventSelectedDate.toLocaleDateString('en-US') != (new Date()).toLocaleDateString('en-US')){
let sortedDate = this.eventSource.sort((a,b) =>{
return (b.startTime) -(a.startTime);
});
let sortedDate = this.eventSource.sort((a,b) =>{
return (b.startTime) -(a.startTime); let filterDate = sortedDate.filter((e) => {
}); return e.startTime.toLocaleDateString('en-US') == this.eventSelectedDate.toLocaleDateString('en-US');
});
let filterDate = sortedDate.filter((e) => { const firstEventStartHours = new Date(filterDate[filterDate.length - 1].startTime).getHours();
return e.startTime.toLocaleDateString('en-US') == this.eventSelectedDate.toLocaleDateString('en-US');
}); const scrollContainer = document.querySelector('.timeline-wrapper');
const firstEventStartHours = new Date(filterDate[filterDate.length - 1].startTime).getHours();
const scrollContainer = document.querySelector('.timeline-wrapper');
scrollContainer.scroll({
top: firstEventStartHours*60,
left: 0,
behavior: 'smooth'
})
scrollContainer.scroll({
top: firstEventStartHours*60,
left: 0,
behavior: 'smooth'
})
}
}, 500); }, 500);
} }
@@ -109,12 +109,6 @@ export class ViewEventPage implements OnInit {
async editEventDetail() { async editEventDetail() {
let classs;
if( window.innerWidth <= 800){
classs = 'modal'
} else {
classs = 'modal modal-desktop'
}
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: EditEventPage, component: EditEventPage,
@@ -122,7 +116,7 @@ export class ViewEventPage implements OnInit {
eventId: this.loadedEvent.EventId, eventId: this.loadedEvent.EventId,
profile: this.profile, profile: this.profile,
}, },
cssClass: classs, cssClass: 'modal modal-desktop',
}); });
} }
@@ -131,7 +125,7 @@ export class ViewEventPage implements OnInit {
let classs; let classs;
if( window.innerWidth <= 800){ if( window.innerWidth <= 800){
classs = 'modal' classs = 'modal modal-desktop'
} else { } else {
classs = 'modal modal-desktop showAsideOptions' classs = 'modal modal-desktop showAsideOptions'
} }