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

Previous month fails in February/March #118

Open
neufeind opened this issue Mar 1, 2024 · 0 comments
Open

Previous month fails in February/March #118

neufeind opened this issue Mar 1, 2024 · 0 comments

Comments

@neufeind
Copy link

neufeind commented Mar 1, 2024

In app/models/periodictask.rb the values for PREVIOUS_MONTHNAME and PREVIOUS_MONTH are calculated as "now - 2592000", where 2592000 is 30 days (in seconds). Obviously this fails at least once a year at the beginning of March, because February has 28 or 29 days.
On 1st March
expected: February
actual result: January

Maybe subtract the current day of month (multiplied by 86400) to return the last day of the previous month correctly?

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

No branches or pull requests

1 participant