From cbd108b80ec76ce1d4e1fbf6245a6ec66b5d231b Mon Sep 17 00:00:00 2001 From: OS-pedrogustavobilro Date: Fri, 29 Nov 2024 16:42:50 +0000 Subject: [PATCH] fix: Validate times before creating event in phone's Calendar App. This way it is aligned with iOS References: https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment --- src/android/nl/xservices/plugins/Calendar.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/android/nl/xservices/plugins/Calendar.java b/src/android/nl/xservices/plugins/Calendar.java index 58a3f2c..0413155 100644 --- a/src/android/nl/xservices/plugins/Calendar.java +++ b/src/android/nl/xservices/plugins/Calendar.java @@ -360,6 +360,11 @@ private void createEventInteractively(JSONArray args) { final JSONObject jsonFilter = args.getJSONObject(0); final JSONObject argOptionsObject = jsonFilter.getJSONObject("options"); + if(jsonFilter.getLong("startTime") > jsonFilter.getLong("endTime")){ + callback.error("The start date must be before the end date"); + return; + } + cordova.getThreadPool().execute(new Runnable() { @Override public void run() {