This is a migrated thread and some comments may be shown as answers.

Timezone Issue in Month + Timeline view

1 Answer 65 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 11 Oct 2011, 08:05 AM

Hi
I'm using Q2 2011 SP1 (v2011.2.11.0831) and have discovered differences in Appointment.Start + End DateTime values between Dayview Viewtypes and Monthview,Timelineview.

//all views are initialized with
            if (utcPlusOneTimeZone == null)
            {
                //utcPlustOneTimeZoneInfo = new SystemTime.TimeZoneInformation();
                //utcPlustOneTimeZoneInfo = TimeZoneInfo.Local;
                //utcPlustOneTimeZoneInfo.bias = -60;
                //utcPlustOneTimeZoneInfo.daylightBias = -60;
                //utcPlusOneTimeZone = new SchedulerTimeZone(utcPlustOneTimeZoneInfo, "CH");
  
                utcPlusOneTimeZone = new SchedulerTimeZone(TimeZone.CurrentTimeZone);
             }
            switch (vt)
            {
                case SchedulerViewType.Day:
                    if (_dayView == null)
                    {
                        _dayView = radScheduler1.GetDayView();
                        _dayView.DefaultTimeZone = utcPlusOneTimeZone;
                    }
                    break;
                case SchedulerViewType.Month:
                    if (_monthView == null)
                    {
                        _monthView = radScheduler1.GetMonthView();
                        _monthView.DefaultTimeZone = utcPlusOneTimeZone;
                    }
                    break;
                case SchedulerViewType.Timeline:
                    if (_timelineView == null)
                    {
                        _timelineView = radScheduler1.GetTimelineView();
                        _timelineView.DefaultTimeZone = utcPlusOneTimeZone;
                    }
                    break;
  
  
//save function calls webservice
  
                DateTime start = app.Start.ToLocalTime();
                DateTime end = app.End.ToLocalTime();
                if (systemService.ChangePlanningElement(app.ElementGID.ToString(), start,end)) return true;

- Month + Timelineview  :  app.Start.Kind = Unspecified  and ToLocalTime() adds 2hours (utc+1 + Summertime)
- other dayview type      :  app.Start.Kind = Local  and and ToLocalTime()  = 0

 

//Workaround before calling webservice 
TimeSpan tsOffset = app.Start.ToLocalTime() - app.Start; 
DateTime start = app.Start.ToLocalTime() - tsOffset;  //subtracts 0 or Timezonedifference

Why ist MonthCellElement.Date of Type Unspecified with TimezoneOffset=2h and SchedulerCellElement.Date of type Local with TimezoneOffset=0h

Thanks for clearing, Daniel

1 Answer, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 13 Oct 2011, 08:36 AM
Hello Daniel,

Thank you for contacting us.

Your question is about SchedulerCellEment's Date property, but your code demonstrates usage of the Appointments' Start property which gets me a bit confused. However, I am not able to find any discrepancies between the different views. The dates of the cells are generated according to the View's StartDate, so the problem might be related to some custom setting of this property. In general, the dates in the cell elements are with Date.Kind = Local because they do not depend on the current timezone and the dates of the appointment elements are with Date.Kind = Unspecified because they represent a date that might be different in different timezones.

You can open a new support ticket and send me a sample project which reproduces the issue. This will let me investigate what causes it and provide you with more accurate answers.

I hope this is useful. Feel free to contact us if you need further help.

Best wishes,
Ivan Todorov
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Tags
Scheduler and Reminder
Asked by
Daniel
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Share this question
or