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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ejs-schedule Timezone issue

Thread ID:

Created:

Updated:

Platform:

Replies:

146598 Aug 9,2019 04:16 PM UTC Aug 13,2019 01:35 PM UTC Angular - EJ 2 3
loading
Tags: Schedule
Chris Watt
Asked On August 9, 2019 04:16 PM UTC

Hi,

I'm currently implementing the ejs-schedule control into an Angular 6 project with a REST Web API back-end. Both the API and Client (both the same localhost machine at present) are on Europe/London time zone (currently GMT + 1 with summer time).

Here is the code I'm using for the control:

<ejs-schedule #scheduleObj
                [eventSettings]="eventSettings"
                [(selectedDate)]="selectedDate"
                width="100%"
                height="100%"
                [group]="techniciansGroup"
                timezone="Europe/London"
                workHours="workHours"
                showTimeIndicator="true"
                startHour="08:00"
                endHour="19:00"
                (navigating)="onNavigating($event)"
                (eventRendered)="onPlannerEventRendered($event)"
                (actionBegin)="onActionBegin($event)"
                (actionComplete)="onActionComplete($event)"
                (actionFailure)="onActionFailure($event)">
                <e-views>
                    <e-view option='Day'></e-view>
                </e-views>
                <e-resources>
                    <e-resource
                        field='assignedTechnicianIDs'
                        title='Technicians'
                        name='Technicians'
                        [allowMultiple]="allowMultiple"
                        [dataSource]='technicians'
                        textField='shortName'
                        idField='id'
                        colorField='backColour'>
                    </e-resource>
                </e-resources>
            </ejs-schedule>
Whatever I try, all events in the schedule are being rendered as 1 hour earlier than they actually are. For example, an event starting at 11am will be rendered at 10am, and so on.

Inspecting the values being passed to and from the API using server-side debugging, I can see that the events are all being sent back and forth with the correct date. It is only when it renders on the schedule that it shows incorrectly.

I have tried using many different time zone settings but so far have had no luck. My best guess is that the schedule is perhaps ignoring the fact that it is currently in Summer Time, and is therefore seeing its data source as GMT+1 and so subtracting 1 hour from the times provided. I've got no idea how to stop this behaviour - all I want is for the planner to display the times as provided by the server, with no adjustment for time zone.

Many thanks,

Chris

Karthigeyan Krishnamurthi [Syncfusion]
Replied On August 12, 2019 06:14 AM UTC

Hi Chris,

 

Syncfusion greetings.

 

When a time zone is set to Scheduler, the events will be displayed exactly based on the Scheduler timezone regardless of its client timezone. Kindly remove the timezone property and check once.

https://ej2.syncfusion.com/angular/documentation/schedule/timezone/?no-cache=1#scheduler-with-no-timezone

 

Regards,

Karthi


Chris Watt
Replied On August 12, 2019 08:53 AM UTC

Hi Karthi,

I have removed the timezone property, but the issue still occurs. If I move an event to a specific time (e.g. 11am) it gets saved to the database at that time, and returned to the client correctly, but the scheduler is still displaying it at 10am.

Kind regards,

Chris

Vinitha Devi Murugan [Syncfusion]
Replied On August 13, 2019 01:35 PM UTC

Hi Chris, 
 
By default, Scheduler will send the data in 0 UTC to back end from source and while rendering in UI, it will automictically render the data based on the Schedule timezone. But in Core project, after receiving the data from source, it will automatically add the system timezone and then send to the back end. To avoid this only we suggested to add the below code in Startup.cs file.  
  
public void ConfigureServices(IServiceCollection services)    
{    
    services.AddDbContext<ScheduleDataContext>(options =>    
options.UseSqlServer(Configuration.GetConnectionString("ScheduleDataConnection")));    
    services.AddMvc();    
    services.AddMvc().AddJsonOptions(options =>    
    {    
        options.SerializerSettings.DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Local;    
        options.SerializerSettings.ContractResolver = new DefaultContractResolver();    
    });    
}    
 
Kindly try the above suggested way and if the issue persist still share your request and response screenshot and schedule datasource screenshot to serve you better. 
 
Regards, 
M.Vinitha devi 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon