- ${startTime}${eventlocation}
+ ${startTimeWisthS}${eventlocation}
${subject}
@@ -318,6 +326,78 @@ export class AgendaPage implements OnInit {
`
}
+
+ // for timeline
+ timelineBoxCorrectHeight(timeout){
+
+ setTimeout(()=>{
+ this.eventSource.forEach((el, eventIndex)=>{
+
+ const startEvent = new Date(el.startTime);
+ const endEvent = new Date(el.endTime);
+
+ var minutes = ((endEvent.getTime() - startEvent.getTime()) / 1000) / 60;
+ const top = (startEvent.getTime() - (new Date(2020, 1, 3)).getTime()) /60;
+
+ document.querySelectorAll('.timeline-box').forEach(ele => {
+
+ if(ele.className.indexOf(`timeline-box-event-${eventIndex}`)>=0){
+ ele.setAttribute('style',`height:${minutes}px`);
+ }
+ });
+
+ });
+ },timeout)
+ }
+
+ // for timeline
+
+ timelineFilter(calendarName){
+
+ this.timelineFilterState = calendarName;
+
+ // remove all event
+ this.events = [];
+
+ this.eventsList.forEach((element, eventIndex) => {
+
+ // timeline start
+ const startHours = formatDate(new Date(element.StartDate), 'HH', 'pt');
+ const EndHours = formatDate(new Date(element.EndDate), 'HH', 'pt');
+
+ const startHoursOtherFormate = formatDate(new Date(element.StartDate), 'HH:mm', 'pt');
+ const EndHoursOtherFormate = formatDate(new Date(element.EndDate), 'HH:mm', 'pt');
+
+ if (element.CalendarName == calendarName) {
+ this.events.push({
+ title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject,startHoursOtherFormate,EndHoursOtherFormate, eventIndex),
+ start: setHours(setMinutes(new Date(element.StartDate), 0), parseInt(startHours)),
+ end: setHours(setMinutes(new Date(element.EndDate), 0), parseInt(EndHours)),
+ color: {
+ primary: 'white',
+ secondary: 'white'
+ },
+ id: element.EventId
+ });
+ } else if (calendarName == 'Todos'){
+ this.events.push({
+ title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject,startHoursOtherFormate,EndHoursOtherFormate, eventIndex),
+ start: setHours(setMinutes(new Date(element.StartDate), 0), parseInt(startHours)),
+ end: setHours(setMinutes(new Date(element.EndDate), 0), parseInt(EndHours)),
+ color: {
+ primary: 'white',
+ secondary: 'white'
+ },
+ id: element.EventId
+ });
+ }
+
+ });
+
+ this.onCurrentChanged(this.eventSelectedDate);
+ //
+ this.showTimelineFilterState = false;
+ }
loadRangeEvents(startTime: Date, endTime: Date){
@@ -329,7 +409,6 @@ export class AgendaPage implements OnInit {
case "Combinada":
//Inicializa o array eventSource
this.eventSource=[];
- this.events=[];
if(this.profile == "mdgpr"){
@@ -337,7 +416,7 @@ export class AgendaPage implements OnInit {
response => {
this.eventsList = response;
// loop
- this.eventsList.forEach(element => {
+ this.eventsList.forEach((element, eventIndex) => {
this.eventSource.push({
title: element.Subject,
@@ -347,24 +426,9 @@ export class AgendaPage implements OnInit {
event: element,
calendarName: element.CalendarName
});
-
- // timeline start
- const startHours = formatDate(new Date(element.StartDate), 'HH', 'pt');
- const EndHours = formatDate(new Date(element.EndDate), 'HH', 'pt');
-
- this.events.push({
- title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject),
- start: setHours(setMinutes(new Date(element.StartDate), 0), parseInt(startHours)),
- end: setHours(setMinutes(new Date(element.EndDate), 0), parseInt(EndHours)),
- color: {
- primary: 'white',
- secondary: 'white'
- },
- id: element.EventId
- });
- // timeline end
-
});
+
+ this.timelineFilter(this.timelineFilterState);
this.myCal.update();
this.myCal.loadEvents();
@@ -372,6 +436,7 @@ export class AgendaPage implements OnInit {
this.showLoader = false;
this.showTimeline = true;
+ this.timelineBoxCorrectHeight(500);
this.centralizeTimeline(500);
});
@@ -381,7 +446,7 @@ export class AgendaPage implements OnInit {
this.eventService.getAllPrEvents(formatDate(startTime, 'yyyy-MM-dd HH:mm:ss', 'pt'), formatDate(endTime, 'yyyy-MM-dd HH:mm:ss', 'pt')).subscribe(
response => {
this.eventsList = response;
- this.eventsList.forEach(element => {
+ this.eventsList.forEach((element, eventIndex) => {
this.eventSource.push({
title: element.Subject,
startTime: new Date(element.StartDate),
@@ -391,30 +456,16 @@ export class AgendaPage implements OnInit {
calendarName: element.CalendarName
});
- // timeline start
- const startHours = formatDate(new Date(element.StartDate), 'HH', 'pt');
- const EndHours = formatDate(new Date(element.EndDate), 'HH', 'pt');
-
- this.events.push({
-
- title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject),
- start: setHours(setMinutes(new Date(element.StartDate), 0), parseInt(startHours)),
- end: setHours(setMinutes(new Date(element.EndDate), 0), parseInt(EndHours)),
- color: {
- primary: 'white',
- secondary: 'white'
- },
- id: element.EventId
- });
- // timeline end
-
});
+ this.timelineFilter(this.timelineFilterState);
+
this.myCal.update();
this.myCal.loadEvents();
this.showLoader = false;
this.showTimeline = true;
+ this.timelineBoxCorrectHeight(500);
this.centralizeTimeline(500);
});
@@ -592,8 +643,5 @@ export class AgendaPage implements OnInit {
});
await modal.present();
modal.onDidDismiss();
- }
-
-
-
-}
+ }
+}
\ No newline at end of file
diff --git a/src/global.scss b/src/global.scss
index 3632634e5..01e714836 100644
--- a/src/global.scss
+++ b/src/global.scss
@@ -122,6 +122,10 @@ td.monthview-secondary-with-event, td.monthview-secondary-with-event[_ngcontent-
}
.timeline-box{
+
+ position: relative;
+ width: calc(100% - 0px);
+ border-radius: 5px;
padding: 3px;
background-color: white !important;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07) !important;
@@ -141,22 +145,22 @@ td.monthview-secondary-with-event, td.monthview-secondary-with-event[_ngcontent-
.timeline-pr-box-Pessoal{
+ border-left: 5px solid #958bfc !important;
- border-left: 5px solid #99e47b !important;
height: 100%;
}
.timeline-pr-box-Oficial{
-
- border-left: 5px solid #958bfc !important;
+ border-left: 5px solid #99e47b !important;
height: 100%;
}
.timeline-mdgpr-box-Oficial{
- border-left: 5px solid #ffb703 !important;
+ border-left: 5px solid #f05d5e !important;
+
}
.timeline-mdgpr-box-Pessoal{
- border-left: 5px solid #f05d5e !important;
+ border-left: 5px solid #ffb703 !important;
}
@@ -181,10 +185,10 @@ td.monthview-secondary-with-event, td.monthview-secondary-with-event[_ngcontent-
width: 35px !important;
}
.calendar-mdgpr-event-type-Oficial{
- border-right: 3px solid #f05d5e !important;
+ border-left: 3px solid #ffb703 !important;
}
.calendar-mdgpr-event-type-Pessoal{
- border-left: 3px solid #ffb703 !important;
+ border-right: 3px solid #f05d5e !important;
}
.calendar-mdgpr-event-type-both{
border-left: 3px solid #ffb703 !important;
@@ -198,6 +202,7 @@ td.monthview-secondary-with-event, td.monthview-secondary-with-event[_ngcontent-
.calendar-pr-event-type-Oficial{
border-left: 3px solid #99e47b !important;
}
+
.calendar-pr-event-type-Pessoal{
border-left: 3px solid #958bfc !important;
}
@@ -222,4 +227,35 @@ td.monthview-secondary-with-event, td.monthview-secondary-with-event[_ngcontent-
thead{
display: none;
}
-}
\ No newline at end of file
+}
+
+
+.calendar-top0{
+ margin-top: 0px;
+}
+
+.calendar-top15{
+ margin-top: 15px;
+}
+
+.calendar-top30{
+ margin-top: 30px;
+}
+
+.calendar-top45{
+ margin-top: 45px;
+}
+
+
+.cal-event{
+ overflow: visible !important;
+}
+
+
+
+
+
+/* .cal-week-view mwl-calendar-week-view-hour-segment, .cal-week-view .cal-hour-segment {
+ display: block;
+ height: 60px !important;
+} */
\ No newline at end of file