Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appointment created by ews-javascript-api are shown in Monrovia timezone #435

Open
tareqassi opened this issue Mar 22, 2024 · 3 comments
Open

Comments

@tareqassi
Copy link

On a nodejs app , I am using ews-javascript-api module to create appointments on exchange server (2013) . I've noticed the behavior that when an appointment is created , it is being shown correctly on the outlook calendar view but if I double click on the appointment and open the reply form of the appointment , the appointment's start/end times are shown on Monrovia time zone

Screenshot 2024-03-22 at 2 31 07 PM

I tried it with following code

const event = new ews.Appointment(service)
event.Subject = eventPayload.title
event.Start = new ews.DateTime(eventPayload.start.toString())
event.StartTimeZone =  ews.TimeZoneInfo.Local
event.End = new ews.DateTime(eventPayload.end.toString())
event.EndTimeZone =  ews.TimeZoneInfo.Local

and I also tried it without setting StartTimeZone/EndTimeZone but got the same issue. I am sending the start/end dates on the utc format and the goal is to show the created appointments on outlook same as the user's timezone

any idea how can I achieve this?

@gautamsi
Copy link
Owner

can you check this in outlook web instead of outlook client?
also check what is the value you get for ews.TimeZoneInfo.Local on your server, this auto timezone detection is not very perfect

@tareqassi
Copy link
Author

@gautamsi thanks for the quick reply
Unfortunately, the issue is on a production server of a client where they have on-premise exchange server. I don't have access to outlook web there.

our nodejs app is on aws , I will add some logs on production and see what value for ews.TimeZoneInfo.Local and re-send it here .
just to make sure that I understand , setting event.StartTimeZone = ews.TimeZoneInfo.Local will get the timezone of nodejs server (aws in our case ) and set it to be the timezone of the appointment ? if yes , then its not what I am looking for .

my goal to show the appointment on the same timezone as the user's timezone
for example if I am sending "2024-06-04T10:30:00.000Z" as start date , it should appear for a user in Berlin as 11:30 (UTC+1)

On the testing environment, we are only provided with outlook web that is also hosted by the client and I don't see this issue on outlook web
Screenshot 2024-03-22 at 3 29 44 PM

@gautamsi
Copy link
Owner

gautamsi commented Apr 1, 2024

you would want to find user timezone and use that timezone instead. if you use ews.TimeZoneInfo.Local it uses moment.tz.guess() which is not something in my control. You have to either set the timezone in code or get it for each user and construct the timezone based on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants