- Home
- Forum
- JavaScript - EJ 2
- Time data already in TimeZone
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.
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.fifaEventsData, null, true); var timezone = new ej.schedule.Timezone(); // Here remove the local offset from events for (var i = 0; i < data.length; i++) { 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
Thank you - I will try that. How can I apply the .removeLocalOffset if using a DataManager?
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
Thank you!
Hi Terry
Lease,
You are most welcome. We are happy that our solution was working for
you.
Regards,
Ashok
- 5 Replies
- 3 Participants
- Marked answer
-
TL Terry Lease
- Jan 13, 2025 12:46 PM UTC
- Jan 17, 2025 07:10 AM UTC