mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
59250: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3) 59188: MNT-9996: All day Calendar events do not show for the first day in the Share Site Calendar grid. Fix unit tests failure. Detect allday events as events with the same start and end dates which have UTC midnight time. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62114 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
package org.alfresco.repo.calendar.cannedqueries;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
@@ -84,6 +83,11 @@ public class GetCalendarEntriesCannedQuery extends AbstractCannedQueryPermission
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
private boolean isMidnightUTC(String isoDate)
|
||||
{
|
||||
return isoDate.endsWith("Z") && (isoDate.indexOf("T00:00:00") != -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<CalendarEntry> queryAndFilter(CannedQueryParameters parameters)
|
||||
{
|
||||
@@ -110,16 +114,11 @@ public class GetCalendarEntriesCannedQuery extends AbstractCannedQueryPermission
|
||||
|
||||
String strFromDate = result.getFromDate();
|
||||
String strToDate = result.getToDate();
|
||||
if (strFromDate != null && strFromDate.equals(strToDate))
|
||||
if (strFromDate != null && strFromDate.equals(strToDate) && isMidnightUTC(strFromDate))
|
||||
{
|
||||
// it is all day event and should conform with current server's timezone
|
||||
fromDate = ISO8601DateFormat.parseDayOnly(strFromDate, TimeZone.getDefault());
|
||||
// all day event should be from midnight till next midnight
|
||||
Calendar defaultCalendar = ISO8601DateFormat.getCalendar();
|
||||
defaultCalendar.setTime(fromDate);
|
||||
// add one day to toDate
|
||||
defaultCalendar.add(Calendar.DATE, 1);
|
||||
toDate = defaultCalendar.getTime();
|
||||
toDate = fromDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user