We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Timezone is not being applied in the control

Hi  Support:

We are using the component version 15.2600.0.40.

Today we noticed that the appointments in the Schedule control (in every view) are not adjusted by the timezone information that is stored in the database table (StartTimeZone and EndTimeZone columns).

In the past the appointments dates were rendered properly, but now the timezones are not being applied in the UI.

What do you think could be causing that the timezone information is being ignored by the Schedule control.

This is our control definition:

<ej-schedule id="Schedule1" show-quick-window="false" 
             current-date="DateTime.Now"
             time-zone="@ViewData["TimeZone"]" 
             current-view="Month"
             show-all-day-row="true"
             create="onCreate"
             load="onLoad"
             navigation="onNavigation"
             enable-load-on-demand="false"
             action-complete="onComplete"
             start-hour="8" end-hour="17"
             is-dst="true" show-weekend="false"
             appointment-window-open="onAppointmentWindowOpen">
    <e-time-scale enable="false"></e-time-scale>

    <e-appointment-settings id="ID" start-time='"StartTime"' end-time='"EndTime"'
                            start-time-zone='"StartTimeZone"' end-time-zone='"EndTimeZone"'
                            all-day='"AllDay"' recurrence='"Recurrence"' recurrence-rule='"RecurrenceRule"'>

        <e-datamanager url="GetData" crud-url="Schedule/Batch" adaptor="UrlAdaptor"></e-datamanager>

    </e-appointment-settings>

</ej-schedule>


Thanks in advance.


David

3 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team June 7, 2017 03:33 PM UTC

Hi David, 
 
Thank you for contacting Syncfusion support. 
 
By default, Scheduler will render the appointments (from db) based on the system/schedule timezone. If your requirement is to display the appointments as same as the time given in database, kindly set apply-time-offset 
API to false and for the same we have prepared the sample for your reference which can be download from the below location. 

<Code> 
<ej-schedule id="Schedule1" width="100%" height="525px" current-date="new DateTime(2014, 12, 5)"> 
    <e-appointment-settings apply-time-offset="false" id="Id" subject='"Subject"' start-time='"StartTime"' end-time='"EndTime"' all-day='"AllDay"' recurrence='"Recurrence"' recurrence-rule='"RecurrenceRule"'> 
        <e-datamanager url="Home/GetData" crud-url="Home/Batch" adaptor="UrlAdaptor"></e-datamanager> 
    </e-appointment-settings> 
</ej-schedule> 
</Code> 

If we have misunderstood your requirement or else if the above sample doesn’t satisfy your requirement, kindly share the image /video demo which clearly depicts your requirement to proceed further. 
 
Regards, 
Karthigeyan 



DS dsapo June 7, 2017 06:44 PM UTC

HI Karthigeyan:

I will try to elaborate more on this.

Suppose you create an appointment with the following dates:

StartDateTime      8:00 AM
EndDatetime        5:00 PM


When you save this in the database table you have:

StartTime                         StartTimeZone EndTime                         EndTimeZone
2017-06-19 12:00:00   UTC -5:00        2017-06-19 21:00:00 UTC -5:00


But in the UI (Month View), you will see that the date says 12:00 PM - 9:00 PM, rather than 8:00 AM - 5:00 PM.   See attachment.

Why the timezone is not being applied.

Thanks again

David 


Attachment: schedule_4350a514.zip


KK Karthigeyan Krishnamurthi Syncfusion Team June 8, 2017 08:50 AM UTC

Hi David,  
 
Thanks for your update. 
 
We suspect that time-zone, StartTimeZone, and EndTimeZone fields are not maintained with same values which could be the cause for the issue. In latest version 15.2.0.40, it is not necessary to use those fields to display the appointments as same as the time given in database alternatively apply-time-offset API can be set false. In our previous sample, we have set apply-time-offset to false where no time-zone, StartTimeZone, and EndTimeZone fields where used both at index file and database, kindly check our sample and below JS sample is made for your reference with applyTimeOffset API.  
 
Regards, 
Karthigeyan 


Loader.
Up arrow icon