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

Unchecking isAllDay has no effect #463

Closed
WilliamWsyHK opened this issue Nov 14, 2019 · 6 comments · Fixed by #578
Closed

Unchecking isAllDay has no effect #463

WilliamWsyHK opened this issue Nov 14, 2019 · 6 comments · Fixed by #578

Comments

@WilliamWsyHK
Copy link

Version

1.12.7

Development Environment

Windows IE 11 and Chrome 78

Current Behavior

Unchecking isAllDay has no effect. The beforeUpdateSchedule does not populate any changes when isAllDay is unchecked.

beforeUpdateSchedule: function (e) {
    let schedule = e.schedule;
    // here when nothing else changes except isAllDay, then changes === null.
    let changes = e.changes || {};
    console.log(changes.isAllDay);
    // should print "undefined".
}

Expected Behavior

isAllDay === false if the user has click to uncheck the all day checkbox.

@mariusa
Copy link

mariusa commented Nov 21, 2019

Set category = 'allday'
isAllDay is a read-only property

@WilliamWsyHK
Copy link
Author

Maybe you mis-understood, but what I mean is not changing the isAllDay in my code, but when beforeUpdateSchedule is being called, value of isAllDay is not set. You can also experience the same in example app, especially unchecking the "All Day" checkbox.

@mariusa
Copy link

mariusa commented Nov 24, 2019

I recommend to use category == 'allday' to check. Simpler than having N properties isThis, isThat, isScheduleStartingAt8AM...

@WilliamWsyHK
Copy link
Author

Thanks @mariusa, but that will definitely defeat the purpose of having isAllDay from the start, i.e. why the team create such property if you are not intentionally change its value when there is updates on the field? This is just confusing.

But for now it make sense to use category === 'allday' to check, provided that the update will populate the changed value.

@mariusa
Copy link

mariusa commented Nov 26, 2019 via email

@jungeun-cho
Copy link
Contributor

@WilliamWsyHK
I reproduced it.
If you changed the All Day checkbox
It is correct to send isAllDay or category information in changes.

I'll fix it in the next patch version.

@jungeun-cho jungeun-cho added this to the v1.12.13 milestone Apr 9, 2020
jungeun-cho added a commit that referenced this issue Apr 23, 2020
fix: check defined properties on beforeUpdateSchedule(fix #463)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants