Skip to content

Commit

Permalink
Caldav: Fix #337 take timezone into account when looking for excluded…
Browse files Browse the repository at this point in the history
… occurrence

git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@3517 3d1905a2-6b24-0410-a738-b14d5a86fcbd
  • Loading branch information
mguessan committed Mar 10, 2024
1 parent 2caed4b commit 688bfda
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/java/davmail/exchange/ews/EwsExchangeSession.java
Expand Up @@ -1497,7 +1497,12 @@ protected void handleExcludedDates(ItemId currentItemId, VCalendar vCalendar) th
for (VProperty property : excludedDates) {
List<String> values = property.getValues();
for (String value : values) {
String convertedValue = convertCalendarDateToExchange(value) + "Z";
String convertedValue;
try {
convertedValue = vCalendar.convertCalendarDateToExchangeZulu(value, property.getParamValue("TZID"));
} catch (IOException e) {
throw new DavMailException("EXCEPTION_INVALID_DATE", value);
}
LOGGER.debug("Looking for occurrence " + convertedValue);

int instanceIndex = 0;
Expand All @@ -1513,6 +1518,7 @@ protected void handleExcludedDates(ItemId currentItemId, VCalendar vCalendar) th
executeMethod(getItemMethod);
if (getItemMethod.getResponseItem() != null) {
String itemOriginalStart = getItemMethod.getResponseItem().get(Field.get("originalstart").getResponseName());
LOGGER.debug("Occurrence " + instanceIndex + " itemOriginalStart "+itemOriginalStart+" looking for "+convertedValue);
if (convertedValue.equals(itemOriginalStart)) {
// found item, delete it
DeleteItemMethod deleteItemMethod = new DeleteItemMethod(new ItemId(getItemMethod.getResponseItem()),
Expand Down

0 comments on commit 688bfda

Please sign in to comment.