mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
bug solve seltet date
This commit is contained in:
@@ -497,7 +497,7 @@
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-toolbar class="footer-toolbar px-20">
|
||||
<ion-buttons slot="start">
|
||||
<button class="btn-ok" fill="clear" color="#fff" (click)="save_v2()">
|
||||
<button class="btn-ok" fill="clear" color="#fff" (click)="validationEditAllEvent()">
|
||||
<ion-label>Gravar</ion-label>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
|
||||
@@ -129,7 +129,7 @@ export class EditEventPage implements OnInit {
|
||||
this.postEvent.Attendees[index].UserType = userData.UserType
|
||||
}
|
||||
|
||||
console.log('jhv',this.postEvent.Category)
|
||||
console.log('jhv', this.postEvent.Category)
|
||||
|
||||
}
|
||||
|
||||
@@ -367,7 +367,33 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async save_v2() {
|
||||
validationEditAllEvent() {
|
||||
if (this.postEvent.IsRecurring) {
|
||||
this.alertController.create({
|
||||
header: 'Editar evento?',
|
||||
message: 'Este evento tem recorrência, deseja editar a Sequência de eventos?',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Sim',
|
||||
handler: () => {
|
||||
this.save_v2(true)
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Não',
|
||||
handler: () => {
|
||||
this.save_v2(false)
|
||||
}
|
||||
}
|
||||
]
|
||||
}).then(res => {
|
||||
res.present();
|
||||
});
|
||||
} else {
|
||||
this.save_v2(false)
|
||||
}
|
||||
}
|
||||
async save_v2(editAllEvent) {
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
@@ -377,7 +403,8 @@ export class EditEventPage implements OnInit {
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
try {
|
||||
|
||||
this.agendaDataRepository.updateEvent(this.postEvent.EventId, this.postEvent).subscribe((value) => {
|
||||
|
||||
this.agendaDataRepository.updateEvent(this.postEvent.EventId, this.postEvent, editAllEvent).subscribe((value) => {
|
||||
console.log(value)
|
||||
}, ((error) => {
|
||||
console.log('edit event error: ', error)
|
||||
|
||||
@@ -124,20 +124,20 @@ export class AgendaDataRepositoryService {
|
||||
return this.agendaDataService.createEvent(eventInput)
|
||||
}
|
||||
|
||||
updateEvent(eventId, eventData) {
|
||||
updateEvent(eventId, eventData, editAllEvent) {
|
||||
let eventInput = {
|
||||
subject: eventData.Subject,
|
||||
body: eventData.Body.Text || eventData.Body,
|
||||
location: eventData.Location,
|
||||
startDate: eventData.StartDate,
|
||||
endDate: eventData.EndDate,
|
||||
startDate: this.utils.addOneHourToIsoString(eventData.StartDate),
|
||||
endDate: this.utils.addOneHourToIsoString(eventData.EndDate),
|
||||
isAllDayEvent: eventData.IsAllDayEvent,
|
||||
updateAllEvents: false,
|
||||
updateAllEvents: editAllEvent,
|
||||
type: this.utils.calendarTypeSeleted(eventData.Category),
|
||||
category: this.utils.calendarCategorySeleted(eventData.CalendarName),
|
||||
recurrence: {
|
||||
frequency: this.utils.eventRecurence(eventData.EventRecurrence.frequency),
|
||||
until: eventData.EventRecurrence.until
|
||||
until: ((eventData.EventRecurrence.until === "") ? this.utils.addOneHourToIsoString(eventData.EndDate.toISOString()) : eventData.EventRecurrence.until),
|
||||
}
|
||||
}
|
||||
return this.agendaDataService.updateEvent(eventId, eventInput)
|
||||
@@ -198,11 +198,13 @@ export class AgendaDataRepositoryService {
|
||||
await this.createOwnCalendar()
|
||||
return await this.agendaLocalDataSourceService.bulkCreate(result.value.data)
|
||||
} else {
|
||||
await this.agendaLocalDataSourceService.clearSharedCalendar()
|
||||
await this.createOwnCalendar()
|
||||
return result
|
||||
}
|
||||
} else {
|
||||
|
||||
await this.agendaLocalDataSourceService.clearSharedCalendar()
|
||||
return await this.createOwnCalendar()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -129,6 +129,6 @@ export class AgendaDataService {
|
||||
|
||||
@APIReturn(SharedCalendarListOutputDTOSchema)
|
||||
async getSharedCalendar() {
|
||||
return await this.httpService.get<SharedCalendarListOutputDTO>(`${this.baseUrl}/Users/id/ShareCalendar?id=${SessionStore.user.UserId}`);
|
||||
return await this.httpService.get<SharedCalendarListOutputDTO>(`${this.baseUrl}/Users/${SessionStore.user.UserId}/ShareCalendar`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,8 +180,18 @@ export class Utils {
|
||||
|
||||
addOneHourToIsoString(isoDateString) {
|
||||
let date = new Date(isoDateString);
|
||||
/* date.setHours(date.getHours()); */
|
||||
let newIsoDateString = date.toISOString();
|
||||
return newIsoDateString;
|
||||
|
||||
const tzOffset = -date.getTimezoneOffset(); // in minutes
|
||||
const diff = tzOffset >= 0 ? '+' : '-';
|
||||
const pad = (n: number) => (n < 10 ? '0' : '') + n;
|
||||
|
||||
return date.getFullYear() +
|
||||
'-' + pad(date.getMonth() + 1) +
|
||||
'-' + pad(date.getDate()) +
|
||||
'T' + pad(date.getHours()) +
|
||||
':' + pad(date.getMinutes()) +
|
||||
':' + pad(date.getSeconds()) +
|
||||
diff + pad(Math.floor(Math.abs(tzOffset) / 60)) +
|
||||
':' + pad(Math.abs(tzOffset) % 60);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ export class EditEventToApprovePage implements OnInit {
|
||||
|
||||
try {
|
||||
/* await this.eventsService.postEventToApproveEdit(event).toPromise() */
|
||||
this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event).subscribe((value) => {
|
||||
this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event,false).subscribe((value) => {
|
||||
console.log(value)
|
||||
}, ((error) => {
|
||||
console.log('edit event error: ', error)
|
||||
|
||||
@@ -361,7 +361,7 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
try {
|
||||
|
||||
this.agendaDataRepository.updateEvent(this._postEvent.EventId, this._postEvent).subscribe((value) => {
|
||||
this.agendaDataRepository.updateEvent(this._postEvent.EventId, this._postEvent,false).subscribe((value) => {
|
||||
console.log(value)
|
||||
}, ((error) => {
|
||||
console.log('edit event error: ', error)
|
||||
|
||||
@@ -324,7 +324,7 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
this.httpErroHalde.httpStatusHandle(error)
|
||||
}) */
|
||||
|
||||
this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event).subscribe((value) => {
|
||||
this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event,false).subscribe((value) => {
|
||||
console.log(value)
|
||||
}, ((error) => {
|
||||
console.log('edit event error: ', error)
|
||||
|
||||
Reference in New Issue
Block a user