Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsEventsEventsExport to vCal does not handle DST properlyExport to vCal does not handle DST properly
Previous
 
Next
New Post
9/3/2008 12:26 PM
 

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 1:32 PM
 

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


DNN MVP
Events - Get the latest version - Upgrade now!!
Feedback 6.4.2 - Now available - Give it a go!
Find us on Codeplex - DNN Events, DNN Feedback
Requirements/Bugs - Please submit them on Codeplex
 
New Post
9/3/2008 6:38 PM
 

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 12:52 PM
 

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
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsEventsEventsExport to vCal does not handle DST properlyExport to vCal does not handle DST properly


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out