Improve agenda

This commit is contained in:
2021-02-09 16:49:15 +01:00
parent d0248df80a
commit c29b6ac688
6 changed files with 64 additions and 31 deletions
+11 -4
View File
@@ -55,7 +55,8 @@
</table>
<calendar class="calendar-component"
<calendar
class="calendar-component"
[eventSource]="eventSource"
[calendarMode]="calendar.mode"
[currentDate]="calendar.currentDate"
@@ -118,7 +119,8 @@
</thead>
</table>
<calendar class="calendar-component"
<calendar
class="calendar-component"
[eventSource]="eventSource"
[calendarMode]="calendar.mode"
[currentDate]="calendar.currentDate"
@@ -183,7 +185,8 @@
</thead>
</table>
<calendar class="calendar-component"
<calendar
class="calendar-component"
[eventSource]="eventSource"
[calendarMode]="calendar.mode"
[currentDate]="calendar.currentDate"
@@ -217,7 +220,11 @@
<!-- Calendar currente date -->
<ion-row class="ion-justify-content-between ion-align-items-center currente-date-timelien">
<ion-row class="timeline-date">
<ion-row class="timeline-date align-center">
<!-- <ion-icon *ngIf="showCalendar" (click)="showCalendar=false" class="collaps" src="assets/images/icons-add-new-event.svg" >1</ion-icon>
<ion-icon *ngIf="!showCalendar" (click)="showCalendar=true" class="collaps" src="assets/images/icons-add-new-event.svg" >2</ion-icon> -->
<span *ngIf="timelineIsCurrentDate()">Hoje, &nbsp;</span> {{ timelineDate }}
</ion-row>
<ion-row class="filter ion-align-items-center">
+8
View File
@@ -416,6 +416,10 @@ td.monthview-primary-with-event {
font-size: 15px;
font-weight: bold;
}
.collaps{
font-size: 28px;
padding-right: 8px;
}
.filter{
font-size: 15px;
font-weight: normal;
@@ -454,3 +458,7 @@ td.monthview-primary-with-event {
}
}
.showcalendar{
display: none;
}
+16 -13
View File
@@ -51,6 +51,10 @@ export class AgendaPage implements OnInit {
this.view = view;
}
// calendar
showCalendar: boolean;
// timeline
monthList = [
{ name: 'Janeiro', id: 'Jan' },
{ name: 'Fevereiro', id: 'Feb' },
@@ -66,13 +70,12 @@ export class AgendaPage implements OnInit {
{ name: 'Dezembro', id: 'Dec' }
]
showTimeline: boolean= false;
// for timeline
events: CalendarEvent[] = [];
// timeline filter
timelineFilterState: string = 'Todos';
showTimelineFilterState: boolean= false;
showTimelineFilterState: boolean;
showTimeline: boolean;
/* List of events of our calendar */
eventSource = [];
@@ -119,11 +122,9 @@ export class AgendaPage implements OnInit {
private alertCrontroller: AlertService
) {
this.showCalendar = true;
this.timelineDate = momentG(new Date(),'dd MMMM yyyy');
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
@@ -135,6 +136,8 @@ export class AgendaPage implements OnInit {
setCookie('searchModalAPPType','0', 99999999);
this.showLoader = false;
this.showTimelineFilterState = false;
this.showTimeline = false;
}
@@ -416,9 +419,9 @@ export class AgendaPage implements OnInit {
//Inicializa o array eventSource
this.eventSource=[];
if(this.profile == "mdgpr"){
this.eventService.getAllMdEvents(new Date(startTime).toLocaleString(), new Date(endTime).toLocaleString()).subscribe(
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe(
response => {
this.eventsList = response;
// loop
@@ -449,7 +452,7 @@ export class AgendaPage implements OnInit {
}
else{
this.eventService.getAllPrEvents(new Date(startTime).toLocaleString(), new Date(endTime).toLocaleString()).subscribe(
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(
response => {
this.eventsList = response;
this.eventsList.forEach((element, eventIndex) => {
@@ -482,7 +485,7 @@ export class AgendaPage implements OnInit {
//Inicializa o array eventSource
this.eventSource=[];
if(this.profile == "mdgpr"){
this.eventService.getAllMdEvents(new Date(startTime).toLocaleString(), new Date(endTime).toLocaleString()).subscribe(response => {
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => {
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
this.eventsListPessoal.forEach(element => {
this.eventSource.push({
@@ -499,7 +502,7 @@ export class AgendaPage implements OnInit {
});
}
else{
this.eventService.getAllPrEvents(new Date(startTime).toLocaleString(), new Date(endTime).toLocaleString()).subscribe(response => {
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => {
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
this.eventsListPessoal.forEach(element => {
this.eventSource.push({
@@ -521,7 +524,7 @@ export class AgendaPage implements OnInit {
//Inicializa o array eventSource
this.eventSource=[];
if(this.profile == "mdgpr"){
this.eventService.getAllMdEvents(new Date(startTime).toLocaleString(), new Date(endTime).toLocaleString()).subscribe(res => {
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => {
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
this.eventsListOficial.forEach(element => {
this.eventSource.push({
@@ -537,7 +540,7 @@ export class AgendaPage implements OnInit {
this.showLoader = false;
});
}else{
this.eventService.getAllPrEvents(new Date(startTime).toLocaleString(), new Date(endTime).toLocaleString()).subscribe(res => {
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => {
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
this.eventsListOficial.forEach(element => {
this.eventSource.push({