-
Notifications
You must be signed in to change notification settings - Fork 162
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
Updating the start and end time of an event sets the values wrongly depending on the order the operations are done. #581
Comments
Thanks for your bug report, you're absolutely right of course. This is a problem I have never thought about. I would like to avoid an additional method as it requires additional complexity when using the library. I think it's a manageable breaking change if we do the validation ( |
Hey @sebbo2002, thanks for the quick response, and thanks for the library; it is really useful. Yeah, that would work; another alternative that comes to mind is to make whether to run or not validations configurable and make the default always to run. That way, you would not have any breaking changes, although it might still be weird. Anyhow, whenever you decide which solution makes more sense, I'm also open to creating a PR. |
# [7.0.0-develop.2](v7.0.0-develop.1...v7.0.0-develop.2) (2024-02-29) ### Bug Fixes * **Event:** Run start/end validation only when getting data ([9174a32](9174a32)), closes [#581](#581)
🎉 This issue has been resolved in version 7.0.0-develop.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
I have now given it some more thought and have come to the conclusion that I now always execute the validation when a |
Awesomeness!! Thanks for the quick release! I'll give it a try later today! |
Hey, Sorry for not getting back to you; I got sick and haven't been able to try the fix. |
No problem. We’ll write here again when you’re healthy again. Get well soon. |
Thanks for the fix! I ran into the same problem and with the latest pre-release, it's working :) |
# [7.0.0](v6.0.1...v7.0.0) (2024-03-17) ### Bug Fixes * **Event:** Run start/end validation only when getting data ([9174a32](9174a32)), closes [#581](#581) * fixed GEO missing when supplied (closes [#569](#569)) ([2eeceb8](2eeceb8)) * fixed typo `&&&` to `&&` ([7707b59](7707b59)) ### Features * **Alarm:** Add support for `email` alarm type ([5398f09](5398f09)), closes [#576](#576) * **Event:** Made `ICalEvent.location.title` optional to allow setting `GEO` without title ([42be230](42be230)), closes [#578](#578) ### BREAKING CHANGES * **Event:** [ICalEvent.location()](https://sebbo2002.github.io/ical-generator/develop/reference/classes/ICalEvent.html#location)'s `title` field can now be undefined
🎉 This issue has been resolved in version 7.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sorry for not getting back here before @sebbo2002. Thanks so much for the fix! |
Current Behavior
When I have an existing event, containing for example the following
start
andend
:If I shift the time to the future, for example, 2 hours, by using the
start()
andend()
setters in that order, I get that thestart
value is the oldend
value.Then
Something similar happens by shifting to the past.
Expected Behavior
I understand the validations that introduce this issue, but I think we are missing an API to modify the start and end at the same time to avoid this kind of issue.
Another option is having something like a builder pattern where the checks only happen after calling the
.build()
method. But that probably is a bigger refactor.Having a
shiftTime
method can help, but sometimes you want to change both the start time and the duration of the event.Additional Information
My workaround for now is to set the start one more time after setting the end time.
The text was updated successfully, but these errors were encountered: