return;
}
// get earliest start deadline
List<Deadline> startDeadlines = task.getDeadlines().getStartDeadlines();
Deadline start = null;
for ( Deadline deadline : startDeadlines ) {
if ( start == null || start.getDate().getTime() > deadline.getDate().getTime() ) {
start = deadline;
}
}
// get latest end deadline
List<Deadline> endDeadlines = task.getDeadlines().getEndDeadlines();
Deadline end = null;
for ( Deadline deadline : endDeadlines ) {
if ( end == null || end.getDate().getTime() < deadline.getDate().getTime() ) {
end = deadline;
}
}
String language = userInfo.getLanguageForEntity( owner );
String name = I18NText.getLocalText( task.getNames(),
language,
defaultLanguage );
String summary = I18NText.getLocalText( task.getSubjects(),
language,
defaultLanguage );
String description = I18NText.getLocalText( task.getDescriptions(),
language,
defaultLanguage );
// send ical for start
if ( start != null ) {
try {
sendIcal( task.getId(),
name,
summary,
description,
task.getPriority(),
start.getDate(),
owner,
creator,
createdOn,
userInfo,
"Start" );
} catch ( Exception e ) {
}
}
// send ical for end
if ( end != null ) {
try {
sendIcal( task.getId(),
name,
summary,
description,
task.getPriority(),
end.getDate(),
owner,
creator,
createdOn,
userInfo,
"End" );