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

Fix bug in handling schedules when EndTime < StartTime and are in different timezones #574

Merged
merged 2 commits into from
Jun 25, 2024

Conversation

AndreyNudko
Copy link
Contributor

@AndreyNudko AndreyNudko commented Nov 18, 2022

It was possible to end up in a state when interval end is >24 hours before interval start (this is some quirk of the j.u.Calendar which I don't fully understand - but order of calls to setTimeZone() and setTimeInMillis() somehow matters). Adding 1 day in this case is not enough, since resulting interval is still inverted. This patch addresses the problem by moving end timestamp forward as long as it is behind the start.

Fixes #486

…ferent timezones

It was possible to end up in a state when interval end is >24 hours before interval start (this is some quirk of the j.u.Calendar which I don't fully understand - but order of calls to setTimeZone() and setTimeInMillis() somehow matters). Adding 1 day in this case is not enough, since resulting interval is still inverted.
This patch addresses the problem by moving end timestamp forward as long as it is behind the start.

quickfix-j#486
@chrjohn chrjohn changed the title Fix bug in handling schedules when EndTime < StartTime and are in different timezones Fix bug in handling schedules when EndTime < StartTime and are in different timezones Jan 4, 2023
@chrjohn chrjohn added this to the QFJ 3.0.0 milestone Dec 28, 2023
@chrjohn chrjohn merged commit 9335f8d into quickfix-j:master Jun 25, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuring StartTime and EndTime on different timezones results in wrong schedule calculation
2 participants