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"
|
||||
}
|
||||
},
|
||||
"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": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/date-format/-/date-format-3.0.0.tgz",
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
"axios": "^0.19.2",
|
||||
"capacitor-datepicker": "0.0.2",
|
||||
"cordova-ios": "6.1.0",
|
||||
"date-fns": "^2.15.0",
|
||||
"ionic2-calendar": "^0.6.6",
|
||||
"moment": "^2.27.0",
|
||||
"rxjs": "~6.5.1",
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
|
||||
<!-- <ion-row>
|
||||
<ion-col size="6">
|
||||
<ion-row>
|
||||
<!-- <ion-col size="6">
|
||||
<ion-button (click)="createRandomEvents()" expand="block" fill="outline">
|
||||
Add random events
|
||||
</ion-button>
|
||||
@@ -44,7 +44,12 @@
|
||||
Remove all events
|
||||
</ion-button>
|
||||
</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>
|
||||
<!-- Move back one screen of the slides -->
|
||||
|
||||
@@ -3,6 +3,10 @@ import { CalendarComponent } from 'ionic2-calendar';
|
||||
import { AlertController, ModalController } from '@ionic/angular';
|
||||
import { formatDate } from '@angular/common';
|
||||
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({
|
||||
selector: 'app-agenda',
|
||||
@@ -11,15 +15,15 @@ import { CalModalPage } from '../cal-modal/cal-modal.page';
|
||||
})
|
||||
export class AgendaPage implements OnInit {
|
||||
|
||||
/* event = {
|
||||
title: '',
|
||||
desc: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
event = {
|
||||
title: 'Teste',
|
||||
desc: 'Desc',
|
||||
startTime: '2020,21,08',
|
||||
endTime: '2020,22,08',
|
||||
allDay: false
|
||||
};
|
||||
|
||||
minDate = new Date().toDateString(); */
|
||||
/* minDate = new Date().toDateString(); */
|
||||
|
||||
/* List of events of our calendar */
|
||||
eventSource = [];
|
||||
@@ -37,16 +41,19 @@ export class AgendaPage implements OnInit {
|
||||
@ViewChild(CalendarComponent) myCal: CalendarComponent;
|
||||
|
||||
segment:string;
|
||||
eventsList: Event[];
|
||||
|
||||
constructor(
|
||||
private alertCtrl: AlertController,
|
||||
@Inject(LOCALE_ID) private locale: string,
|
||||
private modalCtrl: ModalController
|
||||
private modalCtrl: ModalController,
|
||||
private eventService: EventsService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
//Inicializar segment
|
||||
this.segment = "combinada";
|
||||
this.createdEvent();
|
||||
/* 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