Skip to content

Previous month fails in February/March #118

@neufeind

Description

@neufeind

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions