Bug 55238 - Timezone for DUE in allday events unhandled in calendar.xml script
Summary: Timezone for DUE in allday events unhandled in calendar.xml script
Status: RESOLVED FIXED
Alias: None
Product: SyncEvolution
Classification: Unclassified
Component: SyncEvolution (show other bugs)
Version: 1.3
Hardware: Other All
: medium normal
Assignee: Patrick Ohly
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-23 12:13 UTC by peterjan
Modified: 2012-10-05 10:29 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description peterjan 2012-09-23 12:13:47 UTC
Timezone for DUE in allday events is unhandled in calendar.xml script ( src/syncevo/configs/scripting/11calendar.xml )

> if (ITEMDATATYPE()=="vCalendar10" && ALLDAYCOUNT(DUE,DUE,TRUE,TRUE)>0) {
>     DUE = DATEONLY(DUE);
> }

should probably have:
>     DUE = CONVERTTOUSERZONE(DUE);
before DUE = DATEONLY(DUE);

Current code leads to wrong due date of a todo task (at least for me and GMT+2 on both the phone and the pc):
> [2012-09-23 12:21:22.795] - Field: DUE = 2012-10-02T22:00:00Z (TZ: UTC) (timestamp)
> [2012-09-23 12:21:22.795] - Expression result: 2012-10-02T22:00:00Z (TZ: UTC) (timestamp)
> [2012-09-23 12:21:22.795] - Parameter #1 (by value) = 2012-10-02T22:00:00Z (TZ: UTC) (timestamp)
> [2012-09-23 12:21:22.795] - DATEONLY() function result = 2012-10-02 (floating) (timestamp)
> [2012-09-23 12:21:22.795] - Assigned expression result = 2012-10-02 (floating) (timestamp)

BTW - thank you for your effort on the project.
Comment 1 Patrick Ohly 2012-09-26 13:03:48 UTC
(In reply to comment #0)
> Timezone for DUE in allday events is unhandled in calendar.xml script (
> src/syncevo/configs/scripting/11calendar.xml )
> 
> > if (ITEMDATATYPE()=="vCalendar10" && ALLDAYCOUNT(DUE,DUE,TRUE,TRUE)>0) {
> >     DUE = DATEONLY(DUE);
> > }
> 
> should probably have:
> >     DUE = CONVERTTOUSERZONE(DUE);
> before DUE = DATEONLY(DUE);

Looks reasonable. Does it fix the problem for you?
Comment 2 peterjan 2012-09-26 19:38:24 UTC
Yes it does - my patched version works fine.
Comment 3 Patrick Ohly 2012-10-05 10:29:56 UTC
Fix is included in 1.3.1 (under preparation):

commit e8adfadceeb062ea3d311f1f651332301cd306c8
Author: Patrick Ohly <patrick.ohly@intel.com>
Date:   Fri Oct 5 10:22:23 2012 +0000

    vCalendar 1.0 + tasks: DUE date could be shifted by a day (FDO #55238)
    
    Because of incomplete support for time conversion, the due date
    could get mixed up when phone and PC were set to something other
    than UTC.
    
    Reported and fixed by Peter Jan.

diff --git a/src/syncevo/configs/scripting/11calendar.xml b/src/syncevo/configs/scripting/11calendar.xml
index 613f061..db4720f 100644
--- a/src/syncevo/configs/scripting/11calendar.xml
+++ b/src/syncevo/configs/scripting/11calendar.xml
@@ -117,6 +117,7 @@
         if (SUMMARY==EMPTY) SUMMARY="unnamed"; // set dummy summary if we still don't have one
         // due shaping for non-iCalendar 2.0
         if (ITEMDATATYPE()=="vCalendar10" && ALLDAYCOUNT(DUE,DUE,TRUE,TRUE)>0) {
+          DUE = CONVERTTOUSERZONE(DUE);
           DUE = DATEONLY(DUE);
         }
         if (ITEMDATATYPE()=="vCalendar10") {


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.