mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Unifinished methods in Agenda
This commit is contained in:
Generated
+5
@@ -5541,6 +5541,11 @@
|
|||||||
"assert-plus": "^1.0.0"
|
"assert-plus": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"date-fns": {
|
||||||
|
"version": "2.15.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.15.0.tgz",
|
||||||
|
"integrity": "sha512-ZCPzAMJZn3rNUvvQIMlXhDr4A+Ar07eLeGsGREoWU19a3Pqf5oYa+ccd+B3F6XVtQY6HANMFdOQ8A+ipFnvJdQ=="
|
||||||
|
},
|
||||||
"date-format": {
|
"date-format": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/date-format/-/date-format-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/date-format/-/date-format-3.0.0.tgz",
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
"axios": "^0.19.2",
|
"axios": "^0.19.2",
|
||||||
"capacitor-datepicker": "0.0.2",
|
"capacitor-datepicker": "0.0.2",
|
||||||
"cordova-ios": "6.1.0",
|
"cordova-ios": "6.1.0",
|
||||||
|
"date-fns": "^2.15.0",
|
||||||
"ionic2-calendar": "^0.6.6",
|
"ionic2-calendar": "^0.6.6",
|
||||||
"moment": "^2.27.0",
|
"moment": "^2.27.0",
|
||||||
"rxjs": "~6.5.1",
|
"rxjs": "~6.5.1",
|
||||||
|
|||||||
@@ -33,8 +33,8 @@
|
|||||||
</ion-segment>
|
</ion-segment>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
|
|
||||||
<!-- <ion-row>
|
<ion-row>
|
||||||
<ion-col size="6">
|
<!-- <ion-col size="6">
|
||||||
<ion-button (click)="createRandomEvents()" expand="block" fill="outline">
|
<ion-button (click)="createRandomEvents()" expand="block" fill="outline">
|
||||||
Add random events
|
Add random events
|
||||||
</ion-button>
|
</ion-button>
|
||||||
@@ -44,7 +44,12 @@
|
|||||||
Remove all events
|
Remove all events
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
</ion-row> -->
|
<ion-col size="6">
|
||||||
|
<ion-button (click)="createdEvent()" expand="block" fill="outline">
|
||||||
|
Adicionar
|
||||||
|
</ion-button>
|
||||||
|
</ion-col>-->
|
||||||
|
</ion-row>
|
||||||
|
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<!-- Move back one screen of the slides -->
|
<!-- Move back one screen of the slides -->
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ import { CalendarComponent } from 'ionic2-calendar';
|
|||||||
import { AlertController, ModalController } from '@ionic/angular';
|
import { AlertController, ModalController } from '@ionic/angular';
|
||||||
import { formatDate } from '@angular/common';
|
import { formatDate } from '@angular/common';
|
||||||
import { CalModalPage } from '../cal-modal/cal-modal.page';
|
import { CalModalPage } from '../cal-modal/cal-modal.page';
|
||||||
|
import { EventsService } from 'src/app/services/events.service';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { Event } from '../../models/event.model';
|
||||||
|
import { parse } from 'date-fns';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-agenda',
|
selector: 'app-agenda',
|
||||||
@@ -11,15 +15,15 @@ import { CalModalPage } from '../cal-modal/cal-modal.page';
|
|||||||
})
|
})
|
||||||
export class AgendaPage implements OnInit {
|
export class AgendaPage implements OnInit {
|
||||||
|
|
||||||
/* event = {
|
event = {
|
||||||
title: '',
|
title: 'Teste',
|
||||||
desc: '',
|
desc: 'Desc',
|
||||||
startTime: '',
|
startTime: '2020,21,08',
|
||||||
endTime: '',
|
endTime: '2020,22,08',
|
||||||
allDay: false
|
allDay: false
|
||||||
};
|
};
|
||||||
|
|
||||||
minDate = new Date().toDateString(); */
|
/* minDate = new Date().toDateString(); */
|
||||||
|
|
||||||
/* List of events of our calendar */
|
/* List of events of our calendar */
|
||||||
eventSource = [];
|
eventSource = [];
|
||||||
@@ -37,16 +41,19 @@ export class AgendaPage implements OnInit {
|
|||||||
@ViewChild(CalendarComponent) myCal: CalendarComponent;
|
@ViewChild(CalendarComponent) myCal: CalendarComponent;
|
||||||
|
|
||||||
segment:string;
|
segment:string;
|
||||||
|
eventsList: Event[];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private alertCtrl: AlertController,
|
private alertCtrl: AlertController,
|
||||||
@Inject(LOCALE_ID) private locale: string,
|
@Inject(LOCALE_ID) private locale: string,
|
||||||
private modalCtrl: ModalController
|
private modalCtrl: ModalController,
|
||||||
|
private eventService: EventsService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
//Inicializar segment
|
//Inicializar segment
|
||||||
this.segment = "combinada";
|
this.segment = "combinada";
|
||||||
|
this.createdEvent();
|
||||||
/* this.resetEvent(); */
|
/* this.resetEvent(); */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,4 +197,55 @@ export class AgendaPage implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
async createdEvent(){
|
||||||
|
var s = '01-01-1970 00:03:44';
|
||||||
|
var d = new Date(s);
|
||||||
|
console.log(d);
|
||||||
|
|
||||||
|
const defaultStartDate = new Date();
|
||||||
|
const test = parse('Fri Aug 21 2020 14:20:06 GMT+0100 (West Africa Standard Time)', 'd/M/yyyy HH:mm:ss', new Date());
|
||||||
|
console.log(test);
|
||||||
|
const defaultEndDate = new Date();
|
||||||
|
|
||||||
|
await this.eventService.allEvents().subscribe(
|
||||||
|
response => {
|
||||||
|
this.eventsList = response;
|
||||||
|
|
||||||
|
console.log(this.eventsList[0].EventId);
|
||||||
|
|
||||||
|
for(let i=0; i<this.eventsList.length; i++){
|
||||||
|
console.log(this.eventsList[i].EndDate);
|
||||||
|
|
||||||
|
/* 2020-08-14 23:59:59 */
|
||||||
|
|
||||||
|
let eventCopy = {
|
||||||
|
title: this.eventsList[i].Subject,
|
||||||
|
desc: 'Desc',
|
||||||
|
startTime: new Date(), /* this.eventsList[i].StartDate, */
|
||||||
|
endTime:new Date(), /* this.eventsList[i].EndDate, */
|
||||||
|
allDay: false
|
||||||
|
}
|
||||||
|
this.eventSource.push(eventCopy);
|
||||||
|
this.myCal.loadEvents();
|
||||||
|
console.log(eventCopy.startTime);
|
||||||
|
console.log(eventCopy.endTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
/* console.log(this.eventsList[0].Subject);
|
||||||
|
console.log(this.eventsList[0].StartDate);
|
||||||
|
console.log('Size'+this.eventsList.length); */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* this.myCal.loadEvents(); */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user