A bug has been reported in the Recurring date feature, where the next occurrence is shown incorrectly when the initial date is in the future. seanblue provided an example where the recurring date shows February 28, 2021 instead of January 24, 2021. eviltrout investigated the issue and found that the code bases the recurring date on the difference between the current date and today, which seems intentional but incorrect for future dates.
Since this date is in the future, it should show January 24, 2021 as the next occurrence. Instead, it’s showing February 28, 2021.
Actual date: 2021-01-24T13:30:00Z
Screenshot from post preview (in case the preview shows it differently):
Changing the date to 2021-01-25 jumps the date all the way to March 8, 2021, skipping 8 days instead of 1 day. Every 7th day it jumps an extra week, which seems to be why the date is so off. Am I doing something wrong here? Maybe there’s an edge case with creating recurring dates that are in the future in general or in a future year specifically.
I tried changing this in the code to be localDate.datetime and the output was correct in the browser but 4 tests failed. It seemed they were ensuring it works this way, so now I’m wondering if I’m missing something @j.jaffeux? Recurring should be after the date you entered not the current date right?
Yes indeed I think I have overlooked this case and mostly took into consideration when you try to create a date in past and recurring will make it happen in future. Will have a look next week.