Time data already in TimeZone

Hi - Is it possible to specify that the schedule data is within the current timezone but not specify the timezone?


Currently, I am specifying that both the data and the clientside schedule are in UTC.  However now if I show the 'current time', it shows in UTC instead of the local time.




5 Replies 1 reply marked as answer

AK Ashokkumar Karuppasamy Syncfusion Team January 15, 2025 10:02 AM UTC

Hi Terry Lease,

We suggest converting the time into the correct time zone, as shown in the code snippet below. By implementing this, you should be able to resolve the mentioned issues. We have attached the code snippet and sample below. Please try the solution and let us know if you need any further assistance.

Sample: https://ej2.syncfusion.com/javascript/demos/#/tailwind3/schedule/timezone.html

    var data = new ej.base.extend([], window.fifaEventsDatanulltrue);

    var timezone = new ej.schedule.Timezone();

    // Here remove the local offset from events

    for (var i = 0i < data.lengthi++) {

        data[i].StartTime = timezone.removeLocalOffset(data[i].StartTime);

        data[i].EndTime = timezone.removeLocalOffset(data[i].EndTime);

    }

 


Furthermore, if there is a possibility that we misunderstood your requirement, we would greatly appreciate it if you could provide us with additional information about your scenario, along with a video or screenshots. This will help us better align our understanding with your expectations and provide you with the best possible assistance.

Regards,
Ashok



TL Terry Lease January 15, 2025 01:06 PM UTC

Thank you - I will try that.  How can I apply the .removeLocalOffset if using a DataManager?



SR Swathi Ravi Syncfusion Team January 16, 2025 09:55 AM UTC

Hi Terry Lease,

 

By utilizing the Scheduler's dataBinding event, you can remove the localOffset. After retrieving the data from the backend using the DataManager, the dataBinding event will be triggered. In the event handler, the result property will contain the appointments, and you can use remove localOffset to adjust the data.


Regards,

Swathi



TL Terry Lease January 16, 2025 01:52 PM UTC

Thank you!


Marked as answer

AK Ashokkumar Karuppasamy Syncfusion Team January 17, 2025 07:10 AM UTC

Hi Terry Lease,

You are most welcome. We are happy that our solution was working for you. 

Regards,
Ashok


Loader.
Up arrow icon