From 3a19a93b9a30affa697e6eaced7bdf78851c87f7 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 6 Jun 2023 11:49:41 -0600 Subject: [PATCH] Calendar: Adding alarms sometimes gave incorrect "can't add alarms in the past" error Was not sending all values correctly --- calendar/js/app.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/calendar/js/app.ts b/calendar/js/app.ts index b4cc578e82..cfdbbe4a26 100644 --- a/calendar/js/app.ts +++ b/calendar/js/app.ts @@ -48,7 +48,7 @@ import {et2_checkbox} from "../../api/js/etemplate/et2_widget_checkbox"; import {et2_grid} from "../../api/js/etemplate/et2_widget_grid"; import {Et2Textbox} from "../../api/js/etemplate/Et2Textbox/Et2Textbox"; import "./SidemenuDate"; -import {formatDate, formatTime, parseDate} from "../../api/js/etemplate/Et2Date/Et2Date"; +import {Et2Date, formatDate, formatTime, parseDate} from "../../api/js/etemplate/Et2Date/Et2Date"; import {EGW_KEY_PAGE_DOWN, EGW_KEY_PAGE_UP} from "../../api/js/egw_action/egw_action_constants"; import {nm_action} from "../../api/js/etemplate/et2_extension_nextmatch_actions"; import flatpickr from "flatpickr"; @@ -1433,16 +1433,16 @@ export class CalendarApp extends EgwApp if(widget) { var recur_end = widget.getRoot().getWidgetById('recur_enddate'); - if(recur_end && recur_end.getValue && !recur_end.getValue()) + if(recur_end && recur_end.getValue && !recur_end.value) { - recur_end.set_min(widget.getValue()); + recur_end.set_min(widget.value); } // Update end date, min duration is 1 minute - let end = widget.getRoot().getWidgetById('end'); - let start_time = new Date(widget.getValue()); - let end_time = new Date(end.getValue()); - if(end.getValue() && end_time <= start_time) + let end = widget.getRoot().getWidgetById('end'); + let start_time = new Date(widget.value); + let end_time = new Date(end.value); + if(end.value && end_time <= start_time) { start_time.setMinutes(start_time.getMinutes() + 1); end.set_value(start_time); @@ -3392,9 +3392,9 @@ export class CalendarApp extends EgwApp */ alarm_custom_date (selectbox? : HTMLInputElement, _widget? : et2_selectbox) { - var alarm_date = this.et2.getInputWidgetById('new_alarm[date]'); - var alarm_options = _widget || this.et2.getInputWidgetById('new_alarm[options]'); - var start = this.et2.getInputWidgetById('start'); + var alarm_date = this.et2.getWidgetById('new_alarm[date]'); + var alarm_options = _widget || this.et2.getWidgetById('new_alarm[options]'); + var start = this.et2.getWidgetById('start'); if (alarm_date && alarm_options && start) {