commit
c1cececefb
|
@ -98,12 +98,11 @@
|
||||||
|
|
||||||
<ng-container *ngIf="event.timestart + event.timeduration > currentTime">
|
<ng-container *ngIf="event.timestart + event.timeduration > currentTime">
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label stacked><h2>{{ 'addon.calendar.setnewreminder' | translate }}</h2></ion-label>
|
<button ion-button block color="primary" (click)="notificationPicker.open()">
|
||||||
<ion-datetime [(ngModel)]="notificationTimeText" [placeholder]="'core.choosedots' | translate" [displayFormat]="notificationFormat" [min]="notificationMin" [max]="notificationMax"></ion-datetime>
|
{{ 'addon.calendar.setnewreminder' | translate }}
|
||||||
</ion-item>
|
</button>
|
||||||
<ion-item>
|
|
||||||
<button ion-button block color="primary" (click)="addNotificationTime($event)" [disabled]="!notificationTimeText">{{ 'core.save' | translate }}</button>
|
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
<ion-datetime #notificationPicker hidden [(ngModel)]="notificationTimeText" [displayFormat]="notificationFormat" [min]="notificationMin" [max]="notificationMax" [doneText]="'core.add' | translate"(ionChange)="addNotificationTime()"></ion-datetime>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ion-card>
|
</ion-card>
|
||||||
</core-loading>
|
</core-loading>
|
||||||
|
|
|
@ -311,13 +311,8 @@ export class AddonCalendarEventPage implements OnDestroy {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a reminder for this event.
|
* Add a reminder for this event.
|
||||||
*
|
|
||||||
* @param e Click event.
|
|
||||||
*/
|
*/
|
||||||
addNotificationTime(e: Event): void {
|
addNotificationTime(): void {
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
|
|
||||||
if (this.notificationTimeText && this.event && this.event.id) {
|
if (this.notificationTimeText && this.event && this.event.id) {
|
||||||
let notificationTime = this.timeUtils.convertToTimestamp(this.notificationTimeText);
|
let notificationTime = this.timeUtils.convertToTimestamp(this.notificationTimeText);
|
||||||
|
|
||||||
|
@ -349,10 +344,22 @@ export class AddonCalendarEventPage implements OnDestroy {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
this.calendarProvider.deleteEventReminder(id).then(() => {
|
const message = this.translate.instant('core.areyousure');
|
||||||
this.calendarProvider.getEventReminders(this.eventId).then((reminders) => {
|
const okText = this.translate.instant('core.delete');
|
||||||
this.reminders = reminders;
|
|
||||||
|
this.domUtils.showConfirm(message, undefined, okText).then(() => {
|
||||||
|
const modal = this.domUtils.showModalLoading('core.deleting', true);
|
||||||
|
this.calendarProvider.deleteEventReminder(id).then(() => {
|
||||||
|
this.calendarProvider.getEventReminders(this.eventId).then((reminders) => {
|
||||||
|
this.reminders = reminders;
|
||||||
|
});
|
||||||
|
}).catch((error) => {
|
||||||
|
this.domUtils.showErrorModalDefault(error, 'Error deleting reminder');
|
||||||
|
}).finally(() => {
|
||||||
|
modal.dismiss();
|
||||||
});
|
});
|
||||||
|
}).catch(() => {
|
||||||
|
// Cancelled.
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue