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

updateSchedule method does not refresh recurrenceRule and attendees fields #936

Closed
AlenaPliusnina opened this issue Nov 16, 2021 · 2 comments
Labels

Comments

@AlenaPliusnina
Copy link

AlenaPliusnina commented Nov 16, 2021

Describe the bug

I am trying to use updateSchedule method to refresh recurrenceRule and attendees fields. But it doesn't work.

calendar.updateSchedule(schedule.id, schedule.calendarId, {
recurrenceRule: 'repeated events',
attendees: ['David Perez', 'Nicole Oliver']
});

After that I use the method getSchedule: calendar.getSchedule(schedule.id, schedule.calendarId); and the recurrenceRule and attendees fields are still empty.
{
...
recurrenceRule: '',
attendees: [],
....
}

And the display of the icon for the event on the calendar also does not change.

Also, for example, if I create a schedule, I set a field (recurrenceRule: 'repeated events' / attendees: ['David Perez', 'Nicole Oliver']) when it is updated to an empty string / array using the updateSchedule method, nothing happens.

If I try to save information in this fields: title, body, start, end, isAllday, category, location, state, isPrivate, isPending, isFocused, isReadOnly, raw, color, bgColor, borderColor; It works. But if I try to save empty string, for example, in location, title ... fields it doesn't work.

I checked and no changes are saved for: goingDuration, comingDuration, dueDateClass, isVisible, dragBgColor, customStyle.

To Reproduce

Steps to reproduce the behavior:

  1. Update schedule fields recurrenceRule and attendees by using updateSchedule method.
  2. Check if the field (recurrenceRule, attendees) values ​​have changed when using the method getSchedule.
  3. Check if the icons for the displayed event on the calendar have changed.

Expected behavior

It should be possible to change any property of a schedule with the method updateSchedule.

Desktop (please complete the following information):

  • OS: Mac OS
  • Browser: FireFox, Chrome
  • tui.calendar [1.15.1]
@adhrinae
Copy link
Contributor

adhrinae commented Nov 17, 2021

@AlenaPliusnina
Thanks for the report. Apparently, updating the attendees property works for me.
But some other fields you mentioned didn't work. There are missing implementations in the source code, so I need to fix this.

As a workaround, the Schedule is just a Javascript object, so that you can just modify the value of the schedule and call the render method of your calendar instance.

// get schedule & modify fields
let schedule = calendar.getSchedule(id, calendarId);
schedule.attendees = ['David Perez', 'Nicole Oliver'];
schedule.recurrenceRule = 'repeated events';

// then re-render
calendar.render();

@AlenaPliusnina
Copy link
Author

@adhrinae Ok, thanks for the hint.

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

No branches or pull requests

2 participants