|
From: Hauke P. <hau...@gm...> - 2008-04-06 16:55:29
|
Hello once again!
I took a closer look at the Funambol source code and found out that I
was looking at the wrong location. The file that seems to cause my
problem is:
modules\foundation\src\java\com\funambol\foundation\pdi\converter\CalendarToIcalendar.java
To fix the vCalendar/iCalendar problem, I'd like to submit a patch to
this file. Not sure if this is the right place; if it's not, please
correct me.
(concerning the file mentioned above)
---------------------------------------------------------------replace--
if (calendar.getEvent().getDtEnd()!=null){
output.append(composeFieldDtEnd(
calendar.getEvent().getDtEnd()));
}
if (calendar.getEvent().getDtStart()!=null){
output.append(composeFieldDtStart(
calendar.getEvent().getDtStart()));
}
------------------------------------------------------------------with--
if (calendar.getEvent().getVersion().equals("2.0")){
if (calendar.getEvent().getDtEnd()!=null){
output.append(composeFieldDtEnd20(
calendar.getEvent().getDtEnd(),true));
}
if (calendar.getEvent().getDtStart()!=null){
output.append(composeFieldDtStart(
calendar.getEvent().getDtStart(),true));
}
}
else
{
if (calendar.getEvent().getDtEnd()!=null){
output.append(composeFieldDtEnd(
calendar.getEvent().getDtEnd()));
}
if (calendar.getEvent().getDtStart()!=null){
output.append(composeFieldDtStart(
calendar.getEvent().getDtStart()));
}
}
------------------------------------------------------------------------
---------------------------------------------------------------replace--
private StringBuffer composeFieldDtEnd(Property dtEnd) throws
ConverterException {
------------------------------------------------------------------with--
private StringBuffer composeFieldDtEnd(Property dtEnd, boolean
is20=false) throws ConverterException {
------------------------------------------------------------------------
---------------------------------------------------------------replace--
if (TimeUtils.isInAllDayFormat(dtEndVal)) {
------------------------------------------------------------------with--
if (!is20 && TimeUtils.isInAllDayFormat(dtEndVal)) {
------------------------------------------------------------------------
---------------------------------------------------------------replace--
private StringBuffer composeFieldDtStart(Property dtStart) throws
ConverterException {
------------------------------------------------------------------with--
private StringBuffer composeFieldDtStart(Property dtStart, boolean
is20=false) throws ConverterException {
------------------------------------------------------------------------
---------------------------------------------------------------replace--
if (TimeUtils.isInAllDayFormat(dtStartVal)) {
------------------------------------------------------------------with--
if (!is20 && TimeUtils.isInAllDayFormat(dtStartVal)) {
------------------------------------------------------------------------
The patch basically just checks if the version of the {v|i}Calendar in
question is "2.0". If this is the case, it won't add 000000 and 235900
anymore.
Hauke Pribnow
|