date correct on new event

This commit is contained in:
Eudes Inácio
2024-02-29 05:59:53 +01:00
parent fcc75eb8e2
commit 71699c3c39
3 changed files with 16 additions and 87 deletions
@@ -24,6 +24,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
import { TaskService } from 'src/app/services/task.service'
import { ContactsService } from 'src/app/services/contacts.service';
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
import { momentG } from 'src/plugin/momentG';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -125,6 +126,9 @@ export class NewEventPage implements OnInit {
this.selectedDate = this.navParams.get('eventSelectedDate');
this.taskParticipants = this.navParams.get('attendees');
this.CalendarDate = this.navParams.get('CalendarDate')
this.postEvent.StartDate = this.navParams.get('DefaultStartDate')
this.postEvent.EndDate = this.navParams.get('DefaultEndDate')
console.log('end date', this.postEvent.EndDate)
}
ngOnInit() {
@@ -220,8 +224,10 @@ export class NewEventPage implements OnInit {
setDefaultTime() {
console.log('defalt call')
this.postEvent.StartDate = this.roundTimeQuarterHour(this.CalendarDate);
this.postEvent.EndDate = this.roundTimeQuarterHourPlus15(this.postEvent.StartDate);
console.log('defalt call', this.postEvent.StartDate)
}
close() {
@@ -230,7 +236,9 @@ export class NewEventPage implements OnInit {
roundTimeQuarterHour(timeToReturn = new Date()) {
let date: any = new Date(timeToReturn) || new Date();
const minutes = date.getMinutes();
let newdate = new Date();
const minutes = newdate.getMinutes();
date.setHours(newdate.getHours())
date.setSeconds(0);
if (minutes % 15 != 0) {
@@ -806,7 +814,7 @@ export class NewEventPage implements OnInit {
}
let dataa = Object.assign(this.postEvent, { id: eventId })
this.modalController.dismiss(dataa);
this.modalController.dismiss(dataa);
}, (error) => {
loader.remove()
@@ -866,7 +874,7 @@ export class NewEventPage implements OnInit {
this.contacts = filterLoggedUserEmail;
const newAttendees: EventPerson[] = this.contacts;
this.setIntervenient(newAttendees);
this.setIntervenient(newAttendees);
//console.log('Attendes Email', this.contacts)
}
);
@@ -264,7 +264,9 @@ export class NewEventPage implements OnInit {
let date = new Date(timeToReturn) || new Date();
const minutes = date.getMinutes();
let newdate = new Date();
const minutes = newdate.getMinutes();
date.setHours(newdate.getHours())
date.setSeconds(0);
if (minutes % 15 != 0) {