wmcmahan / react-native-calendar-reminders

React Native Module for IOS Calendar Reminders
MIT License
90 stars 20 forks source link

Recurring reminder marked as done changes time of next notification. #15

Closed superandrew213 closed 8 years ago

superandrew213 commented 8 years ago

To replicate:

  1. Add the following reminder:
        RNCalendarReminders.saveReminder('title', {
          notes: 'notes',
          startDate: '2016-10-01T09:45:00.000UTC',
          alarms: [{
            date: '2016-10-01T09:45:00.000UTC'
          }],
          recurrence: 'daily'
        });
  1. Exit app and go to reminders. And mark it as done.
  2. Refresh reminders by click show/hide completed if they don't update by themselves

When you click on info in reminders the alarm date is being changed and a due date has been added (which wasn't there when the reminder was added for the first time and is different from the alarm date).

wmcmahan commented 8 years ago

Thanks @superandrew213. Looks like it might be something with inaccurate timezone on date components. I'll try and get a fix out soon.

superandrew213 commented 8 years ago

@wmcmahan awesome. Thank you!

wmcmahan commented 8 years ago

@superandrew213, I've pushed a patch to fix (hopefully) strange time shifting bug. Thanks for the help. Cheers!

superandrew213 commented 8 years ago

thanks @wmcmahan but for some reason you can't add any recurring reminders anymore. Non recurring ones still work.

wmcmahan commented 8 years ago

Hmm, I also stopped setting dueDate on the native side, unless specified in the JS settings object. Maybe that is messing with the recurrence rules if not set.

RNCalendarReminders.saveReminder('title', {
   notes: 'notes',
   startDate: '2016-10-01T09:45:00.000UTC',
   dueDate: '2016-10-01T09:45:00.000UTC',
   alarms: [{
     date: '2016-10-01T09:45:00.000UTC'
   }],
   recurrence: 'daily'
 });
superandrew213 commented 8 years ago

Yep, it's working with the due date. Could have sworn that I did test it with the due date too. Anyway all good. Thanks!

superandrew213 commented 8 years ago

Will you set the due date on the native side again or will you make it required if recurrence is set?

wmcmahan commented 8 years ago

I could default the dueDate to be the same as the startDate on the native side, if a recurrence rule is set without a dueDate. Would that help, or just make things more confusing?

superandrew213 commented 8 years ago

I think that might help since most of the time the dueDate will be the same as the startDate for recurring reminders. But that's up to you as long as it's in the docs it should be fine either way.