mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
bug solve seltet date
This commit is contained in:
@@ -497,7 +497,7 @@
|
|||||||
<ion-footer class="ion-no-border">
|
<ion-footer class="ion-no-border">
|
||||||
<ion-toolbar class="footer-toolbar px-20">
|
<ion-toolbar class="footer-toolbar px-20">
|
||||||
<ion-buttons slot="start">
|
<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>
|
<ion-label>Gravar</ion-label>
|
||||||
</button>
|
</button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ export class EditEventPage implements OnInit {
|
|||||||
this.postEvent.Attendees[index].UserType = userData.UserType
|
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.injectValidation()
|
||||||
this.runValidation()
|
this.runValidation()
|
||||||
|
|
||||||
@@ -377,7 +403,8 @@ export class EditEventPage implements OnInit {
|
|||||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||||
try {
|
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)
|
console.log(value)
|
||||||
}, ((error) => {
|
}, ((error) => {
|
||||||
console.log('edit event error: ', error)
|
console.log('edit event error: ', error)
|
||||||
|
|||||||
@@ -124,20 +124,20 @@ export class AgendaDataRepositoryService {
|
|||||||
return this.agendaDataService.createEvent(eventInput)
|
return this.agendaDataService.createEvent(eventInput)
|
||||||
}
|
}
|
||||||
|
|
||||||
updateEvent(eventId, eventData) {
|
updateEvent(eventId, eventData, editAllEvent) {
|
||||||
let eventInput = {
|
let eventInput = {
|
||||||
subject: eventData.Subject,
|
subject: eventData.Subject,
|
||||||
body: eventData.Body.Text || eventData.Body,
|
body: eventData.Body.Text || eventData.Body,
|
||||||
location: eventData.Location,
|
location: eventData.Location,
|
||||||
startDate: eventData.StartDate,
|
startDate: this.utils.addOneHourToIsoString(eventData.StartDate),
|
||||||
endDate: eventData.EndDate,
|
endDate: this.utils.addOneHourToIsoString(eventData.EndDate),
|
||||||
isAllDayEvent: eventData.IsAllDayEvent,
|
isAllDayEvent: eventData.IsAllDayEvent,
|
||||||
updateAllEvents: false,
|
updateAllEvents: editAllEvent,
|
||||||
type: this.utils.calendarTypeSeleted(eventData.Category),
|
type: this.utils.calendarTypeSeleted(eventData.Category),
|
||||||
category: this.utils.calendarCategorySeleted(eventData.CalendarName),
|
category: this.utils.calendarCategorySeleted(eventData.CalendarName),
|
||||||
recurrence: {
|
recurrence: {
|
||||||
frequency: this.utils.eventRecurence(eventData.EventRecurrence.frequency),
|
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)
|
return this.agendaDataService.updateEvent(eventId, eventInput)
|
||||||
@@ -198,11 +198,13 @@ export class AgendaDataRepositoryService {
|
|||||||
await this.createOwnCalendar()
|
await this.createOwnCalendar()
|
||||||
return await this.agendaLocalDataSourceService.bulkCreate(result.value.data)
|
return await this.agendaLocalDataSourceService.bulkCreate(result.value.data)
|
||||||
} else {
|
} else {
|
||||||
|
await this.agendaLocalDataSourceService.clearSharedCalendar()
|
||||||
await this.createOwnCalendar()
|
await this.createOwnCalendar()
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
await this.agendaLocalDataSourceService.clearSharedCalendar()
|
||||||
|
return await this.createOwnCalendar()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,6 +129,6 @@ export class AgendaDataService {
|
|||||||
|
|
||||||
@APIReturn(SharedCalendarListOutputDTOSchema)
|
@APIReturn(SharedCalendarListOutputDTOSchema)
|
||||||
async getSharedCalendar() {
|
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) {
|
addOneHourToIsoString(isoDateString) {
|
||||||
let date = new Date(isoDateString);
|
let date = new Date(isoDateString);
|
||||||
/* date.setHours(date.getHours()); */
|
|
||||||
let newIsoDateString = date.toISOString();
|
const tzOffset = -date.getTimezoneOffset(); // in minutes
|
||||||
return newIsoDateString;
|
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 {
|
try {
|
||||||
/* await this.eventsService.postEventToApproveEdit(event).toPromise() */
|
/* 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)
|
console.log(value)
|
||||||
}, ((error) => {
|
}, ((error) => {
|
||||||
console.log('edit event error: ', error)
|
console.log('edit event error: ', error)
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ export class EditEventPage implements OnInit {
|
|||||||
|
|
||||||
try {
|
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)
|
console.log(value)
|
||||||
}, ((error) => {
|
}, ((error) => {
|
||||||
console.log('edit event error: ', error)
|
console.log('edit event error: ', error)
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ export class EditEventToApproveComponent implements OnInit {
|
|||||||
this.httpErroHalde.httpStatusHandle(error)
|
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)
|
console.log(value)
|
||||||
}, ((error) => {
|
}, ((error) => {
|
||||||
console.log('edit event error: ', error)
|
console.log('edit event error: ', error)
|
||||||
|
|||||||
Reference in New Issue
Block a user