Hi,
I just accepted Tru's PR and added another fix for time specs with a constraint on the year. I finally decided not to try to fix the other bug as that would imply a change in behavior that could break someone's config. Let's take an example: if current date is February 29, 2016 06:00 (2016 was a leap year), the next execution of the task with a time spec requiring "month: February, day: 29, hour: 6, min: 0" is going to be March 01, 2017 06:00. It could have been February 29, 2020 06:00 (next leap year after 2016) but this case is simply not handled in the code, leading to the current non-specified behavior.
I spent hours this weekend trying to improve the code but I finally gave up since I could not come up with a clean solution that does not change the behavior.
For those willing to get the fix, please download the version from the master branch for now: https://github.com/linknx/linknx/archive/master.zip
Best regards,
Cyrille
I just accepted Tru's PR and added another fix for time specs with a constraint on the year. I finally decided not to try to fix the other bug as that would imply a change in behavior that could break someone's config. Let's take an example: if current date is February 29, 2016 06:00 (2016 was a leap year), the next execution of the task with a time spec requiring "month: February, day: 29, hour: 6, min: 0" is going to be March 01, 2017 06:00. It could have been February 29, 2020 06:00 (next leap year after 2016) but this case is simply not handled in the code, leading to the current non-specified behavior.
I spent hours this weekend trying to improve the code but I finally gave up since I could not come up with a clean solution that does not change the behavior.
For those willing to get the fix, please download the version from the master branch for now: https://github.com/linknx/linknx/archive/master.zip
Best regards,
Cyrille
Kommentar