Improve timeline

This commit is contained in:
2021-02-02 11:13:45 +01:00
parent 6612b205b2
commit fafb5730fe
+7 -14
View File
@@ -131,14 +131,10 @@ export class AgendaPage implements OnInit {
private router: Router,
private alertCrontroller: AlertService
) {
// timeline inicial date
this.timelineDate = formatDate(new Date,'dd MMMM yyyy', 'pt');
setTimeout(()=>{
// console.log(JSON.stringify(this.events));
// console.log(this.events);
},5000)
// console.log(setHours(setMinutes(new Date(), 0), 12))
function setCookie(cname, cvalue, exdays) {
var d = new Date();
@@ -173,12 +169,9 @@ export class AgendaPage implements OnInit {
});
this.centralizeTimeline();
}
centralizeTimeline() {
centralizeTimeline(timeout: number) {
// auto scroll timeline
setTimeout(() => {
const timelineMarker = document.querySelector('.cal-current-time-marker');
@@ -189,7 +182,7 @@ export class AgendaPage implements OnInit {
scrollContainer.scrollTop = timelineMarker['offsetTop'] - (scrollContainer.offsetHeight/2);
}, 2000);
}, timeout);
}
timelineIsCurrentDate(): Boolean {
@@ -257,7 +250,7 @@ export class AgendaPage implements OnInit {
this.viewDate = new Date(formatDate(ev,'yyyy-MM-dd', 'pt'));
// calendar change date
this.eventSelectedDate = new Date(ev);
this.centralizeTimeline();
this.centralizeTimeline(1000);
};
// changedate
@@ -379,7 +372,7 @@ export class AgendaPage implements OnInit {
this.showLoader = false;
this.showTimeline = true;
this.centralizeTimeline();
this.centralizeTimeline(1000);
});
@@ -422,7 +415,7 @@ export class AgendaPage implements OnInit {
this.showLoader = false;
this.showTimeline = true;
this.centralizeTimeline();
this.centralizeTimeline(1000);
});
}