Fixe ageanda timeline centalizer and header profile

This commit is contained in:
Peter Maquiran
2021-05-12 11:34:28 +01:00
parent 3df73c063a
commit 695bd3a6df
7 changed files with 60 additions and 35 deletions
+23 -21
View File
@@ -198,7 +198,7 @@ export class AgendaPage implements OnInit {
}
//Go to the next view of the calendar month/week/day
next(){
next() {
this.myCal.slideNext();
this.centralizeTimeline(500);
}
@@ -352,11 +352,10 @@ export class AgendaPage implements OnInit {
setTimeout(() => {
const timelineMarker = document.querySelector('.cal-current-time-marker');
const scrollContainer = document.querySelector('.timeline-wrapper');
try {
scrollContainer.scroll({
top: timelineMarker['offsetTop'] - ((scrollContainer['offsetHeight']/2) - 60),
top: parseInt(timelineMarker['style']['top'].replace('px','')) - ((scrollContainer['offsetHeight']/2) - 60),
left: 0,
behavior: 'smooth'
})
@@ -402,7 +401,7 @@ export class AgendaPage implements OnInit {
const profile_ = profile == 'md'? 'mdgpr': 'pr';
return `
<div class="overflow-hidden timeline-box timeline-box-event-${eventIndex} timeline-${profile_}-box-${calendarName} calendar-top${top}">
<div class="overflow-hidden timeline-box timeline-box-event-${eventIndex} timeline-${profile_}-box-${calendarName} calendar-top${top}">
<div>
<span class="timeline-start-time">${startHours.toString().padStart(2, '0')}:${startMinutos.toString().padStart(2, '0')}</span><span class="timeline-location">${eventlocation}</span>
</div>
@@ -888,32 +887,34 @@ export class AgendaPage implements OnInit {
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 filterDate = sortedDate.filter((e) => {
return e.startTime.toLocaleDateString('en-US') == this.eventSelectedDate.toLocaleDateString('en-US');
});
console.log('Event -- ',filterDate[filterDate.length - 1]);
const firstEventStartHours = new Date(filterDate[filterDate.length - 1].startTime).getHours();
let sortedDate = this.eventSource.sort((a,b) =>{
return (b.startTime) -(a.startTime);
});
console.log('firstEventStartHours-- ', firstEventStartHours)
let filterDate = sortedDate.filter((e) => {
console.log( e.startTime.toLocaleDateString('en-US'),' == ',this.eventSelectedDate.toLocaleDateString('en-US'));
return e.startTime.toLocaleDateString('en-US') == this.eventSelectedDate.toLocaleDateString('en-US');
});
console.log('Event -- ',filterDate[filterDate.length - 1], filterDate['startTime']);
const firstEventStartHours = new Date(filterDate[filterDate.length - 1].startTime).getHours();
console.log('firstEventStartHours-- ', firstEventStartHours)
if(firstEventStartHours) {
const scrollContainer = document.querySelector('.timeline-wrapper');
scrollContainer.scroll({
top: firstEventStartHours*60,
left: 0,
behavior: 'smooth'
})
}
}, 500);
}
@@ -926,6 +927,7 @@ export class AgendaPage implements OnInit {
ev.target.complete();
}, 250)
}
showAlert(){
this.alertController.presentAlert("Funcionalidade em desenvolvimento.");
}