fix: offset logic calculated for east_opt not for west_opt #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While testing
Job::new_async_tz
on different timezones with specific set hoursnext_tick_for_job()
was giving wrong results. On further inspection, the next_tick for every job with given timezones was being calculated wrong because the offset logic wasn't working properly while usingwest_opt()
when calculating the fixed offset, mainly because of how signs are treated onFixedOffset
.Changing
west_opt()
foreast_opt()
should suffice as a quick fix. Also, as an alternative solution, when initially calculatingtime_offset_seconds
inJobLocked::new_async_tz
, instead oflocal_minus_utc()
,utc_minus_local()
can be used in conjunction with the originalwest_opt()
.As an example to replicate this problem, following the README, a job can be created like this
Pay attention to the value returned by
next_tick_for_job()
.