Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Maximum ASP
  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

Verndale
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Events Module [...  Export to vCal does not handle DST properly
Previous Previous
 
Next Next
New Post 9/3/2008 10:26 AM
User is offline Derek Bruyere
8 posts
www.uidev.com
10th Ranked


Re: Export to vCal does not handle DST properly 

 Jeff King wrote
 

Events module v3.2.0 on DNN 3.2.2.  When user clicks to "Export Event to Desktop Event" (personal calendar such as Outlook, Palm Desktop, it does not handle Daylight Saving Time.

All was fine converting an event to UTC prior to daylight savings time went into effect. But any event that falls inside the time period of daylight saving time is exported to local calendar 1 hour off. It does not matter what day it is now, it matters what the date of the event is.

I have a partial solution.  This does not solve it for world wide timezones or places in US where DST is not employed such as Hawaii, eastern IN and most of Arizona.  For these cases, the prior behavior exists. That is, no DST offset is considered.

In file EventController:

 Public Function ConvertDateTimeToTZ(ByVal FromDateTime As DateTime, ByVal FromTZ As Integer, ByVal ToTZ As Integer) As DateTime
            ' JJK. need to subtract minutes for Daylight Saving Time.
            ' So, check the FromTZ and determine what TimeZone that is, then check the start/end dates of DST.
            ' If date is between then subtract minutes.

            ' Since there is no way to instantiate a specific TimeZone, let's assume the timezone supports DST
            ' This is a problem in Arizona (-420), Hawaii (-600) and eastern Indiana (-300). So, always add the offset.
            Dim dstOffset As Double

            If ToTZ = 0 Then
                ' Must apply Daylight Saving Time offset.
                Dim tz As TimeZone = TimeZone.CurrentTimeZone ' Timezone of the server

                If tz.IsDaylightSavingTime(FromDateTime) Then ' TODO: need to determine if DST based on FromTZ, not server timezone.
                    Dim daylight As DaylightTime = tz.GetDaylightChanges(DateTime.Now.Year)
                    dstOffset = daylight.Delta.TotalMinutes() ' assumes DST offset is same for target as it is for this server (60 mins). Is this true for all areas/countries?
                Else
                    dstOffset = 0
                End If

            Else
                ' Converting from 1 timezone to another. Assume DST is applied in both
                ' and therefore, no DST offset is needed.
                ' This is a problem if converting FROM or TO a timezone that does not support DST when the other does.
                dstOffset = 0
            End If

            Return FromDateTime.AddMinutes(Convert.ToDouble(ToTZ) - Convert.ToDouble(FromTZ) - dstOffset)
        End Function
 

Hi Jeff,

I really need to implement this and I'm having a bit of trouble just finding the file. I downloaded the source for the Event module and I don't see any project files to open in visual studio. Any help you might be able to offer would be great.

Thank you,

Derek

 
New Post 9/3/2008 11:32 AM
User is offline Roger Selwyn
1042 posts
www.thedivingclub.co.uk
6th Ranked




Re: Export to vCal does not handle DST properly 

Hi Derek,

Just install the source PA file the same as you would install the normal PA, and it will set everything up in your dev environment pretty much correctly. The source files are actually in the resources.zip inside the source.zip file. This is now standard practice on all DNN core modules.

Cheers
Roger


Events 4.0.2 - It's released !! - See the annoucement.
Requirements/Bugs - Submit them here - Gemini - Raise against project 'DNNP', and put 'Events' in the title.
 
New Post 9/3/2008 4:38 PM
User is offline Derek Bruyere
8 posts
www.uidev.com
10th Ranked


Re: Export to vCal does not handle DST properly 

Thank you Roger,

I got that up and made the code change and there is no change to the problem. I'm sure I did something wrong.

 
New Post 9/4/2008 10:52 AM
User is offline Derek Bruyere
8 posts
www.uidev.com
10th Ranked


Re: Export to vCal does not handle DST properly 

After adding this bit of code and doing a buid, it should work right? I don't have to do anything else, replace any dlls or anything?

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Events Module [...  Export to vCal does not handle DST properly
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


DotNetNuke® in Sweden
All service of DotNetNuke® in Sweden.
Olsmar Konsult
Verndale - Web Development, Support, Hosting
Since 1998, Verndale has helped hundreds of emerging and midsize businesses maximize the value and reach of their web assets with a comprehensive offering of strategy, design, development, search marketing and support services.
www.verndale.com
Overlook Technology
Website Development, DotNetNuke Consulting, Module Development, Portal Management
OverlookTechnology.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP