/egilh

Learning by doing

.NET CF 2.0 Pocket Outlook DueDate problem

Posted on Monday, February 26, 2007 11:12 PM

While porting my free Pocket PC applications to .NET CF 2.0 I just discovered an interesting "feature" of the Microsoft Pocket Outlook wrapper. The first port of poToday used my POOM wrapper for .NET CF 1.0 but I decided to drop it for the built in Microsoft PocketOutlook libraries.

My application dropped from 70kb + 30kb of wrapper DLL to only 31kb. Reorganizing the menus I am able to use the application completely without stylus which is pretty neat. But I found a problem with DueDate property that drove me crazy for a while. I can filter on the DueDate like this:

TaskCollection dueTasks = allTasks.Restrict("[DueDate] = \"" +

     System.DateTime.Today.ToString("dd/MM/yy") + "\" and [Complete]=False");

 

But as the following screenshot shows; I cannot set the DueDate to Today as it becomes yesterday:

task.DueDate should have been newDate (i.e. System.DateTime.Today) but it is 24 hours wrong :-(

I guess it converts the date to UTC link before it sets it. Whatever the reason; adding the difference between the current time and UTC works grand:

System.DateTime.Today + (System.DateTime.Now - System.DateTime.UtcNow);

 
I am still dogfooding my apps but I hope to release them soon.




Feel free to drop a few cents in the tip jar if this post saved you time and money

Feedback

# poToday 2.0

5/23/2007 7:34 AM by /egilh

My free Outlook tasks manager for the Pocket PC is available for download from the poToday home page.
Changes in .NET 2.0 version:

The menus have been changed to better take advantage of the application buttons in Windows Mobile 5.0.
Added menu for moving between days, sorting. One of the things I really like with the new menus is that it allows me to do everything with the menus and hardware buttons. No need to take out the stylus.
The application is a lot smaller as it no longer requires and external DLL for talking to Pocket Outlook. This MSDN article has a step by step guide for using COM objects with .NET CF 2.0.
I found what I consider a bug in the Task.DueDate ...


# re: .NET CF 2.0 Pocket Outlook DueDate problem

10/29/2007 7:39 PM by Egil Hogholt

DaylightSavingTime kicked in this weekend and my fix no longer worked.

This is, what I hope is the final, workaround for the bug:

newDate += System.DateTime.Today - System.DateTime.Today.ToUniversalTime();


Post Comment
Title
 

Name
 

Url

Protected by Clearscreen.SharpHIPEnter the code you see:
Comment