2

I am developing a Calendar app where user can select whether he want to auto move the event time based on current timezone or set it as unchanged based on switch button. I am using Eventkit for storing the events and also UILocalnotification for event notifications

For eg.

Scenario 1: User set the time of having a walk after dinner as 9pm (IST) everyday in India.He travels to USA but due to timezone change the event notification occurs at 8.30am (PDT) in the morning.What i want is that the event should take place at 9pm (PDT) in USA also.

Scenario 2: User is in India,He set some online meeting with person in India on Saturday,10pm (IST).He travels to USA,the timezone changed but the meeting should take place at 9.30am (PDT) since its 10pm (IST) in India

The event and notification works in sync,hence need to handle timezone for both ekevent as well as uilocalnotification

Hopefully someone will rescue me from this issue. Thanks

Hardroid
  • 51
  • 6

1 Answers1

0

The UILocationNotification allows you to set a fireDate and a timeZone. If you set timeZone to nil, it'll fire at the specified time, adjusting for time zones as you travel (your 2nd case, i.e. a fixed point in time). If you set timeZone to a valid time zone, it'll fire at that time in any time zone (your 1st case, i.e. a variable point in time).

There's a great explanation here

Community
  • 1
  • 1
dirkgroten
  • 20,112
  • 2
  • 29
  • 42
  • 1
    ohk this goes for uilocalnotification...and how do i go about the ekevent handling?? – Hardroid Apr 13 '16 at 06:59
  • 1
    If you're using `EKEvent` or `EKCalendarItem`, then setting the `timeZone` to `nil` means it's a 'floating' event, so it'll happen at the given time regardless of the time zone (e.g. "lunch at noon"). Setting a `timeZone` puts it at a fixed point in time, that'll adjust if the user moves to a different timeZone. – dirkgroten Apr 13 '16 at 07:55