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

Day is out of range for month #328

Closed
ArekKuczynski opened this issue Jan 1, 2025 · 3 comments
Closed

Day is out of range for month #328

ArekKuczynski opened this issue Jan 1, 2025 · 3 comments
Assignees
Labels
bug Something isn't working Manager Issue Affects the Manager
Milestone

Comments

@ArekKuczynski
Copy link
Collaborator

ArekKuczynski commented Jan 1, 2025

Describe the bug
When attempting to execute a planned scenario start using the Scheduled Start feature and when it is the end of the month, an error occurs. In this situation the next day is the first day of the month (so we change the month).
This Issue was found while performing regression tests: https://github.com/damies13/rfswarm/actions/runs/12547189301/job/35020579903

To Reproduce
Steps to reproduce the behavior:

  1. Change day time on your device to for example: 31/12/2024
  2. Open rfswarm Manager
  3. Plan scheduled start that will start on first day of the month (next day), for example: 31-dec to 1-jan.
  4. See error

Expected behavior
Rfswarm Manager should handle the month change and day when the next day is in a new month.

Screenshots
image

Desktop (please complete the following information):

  • OS: Ubuntu, Windows, MacOS
  • RFSwarm-manager v1.5.0
@ArekKuczynski ArekKuczynski added Manager Issue Affects the Manager potential bug Might be a bug, requires further clarification labels Jan 1, 2025
@damies13
Copy link
Owner

damies13 commented Jan 1, 2025

That's interesting, date time is supposed to handle that automatically and give you back 1/1/2025. Good find

@damies13
Copy link
Owner

damies13 commented Jan 1, 2025

Thinking about it, the last time I looked at this code would have been when python 3.7 was the newest version, i.e. many years ago, so I'm amazed this has never been reported.

The fix is actually quite simple:
https://onecompiler.com/python/434sj4day

st = datetime(n.year, n.month, n.day, int(tarr[0])) + timedelta(days=1)

May need to import timedelta though cause I don't remember using it in the manager anywhere.

If you can make a test case for this, we can push out a 1.4.1 release

@damies13 damies13 added bug Something isn't working and removed potential bug Might be a bug, requires further clarification labels Jan 1, 2025
@ArekKuczynski ArekKuczynski self-assigned this Jan 3, 2025
@ArekKuczynski ArekKuczynski added this to the v1.5.0 milestone Jan 3, 2025
ArekKuczynski added a commit to NiceProjectPoland/rfswarm that referenced this issue Jan 3, 2025
ArekKuczynski added a commit to NiceProjectPoland/rfswarm that referenced this issue Jan 11, 2025
damies13 added a commit that referenced this issue Jan 13, 2025
…#328

Test Case and Bug fix for Issue #328 - Day is out of range for month
@damies13
Copy link
Owner

Merged into release branch v1.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Manager Issue Affects the Manager
Projects
None yet
Development

No branches or pull requests

2 participants