54 Weeks in 2020?

Hi Everyone,

Check this out:

If you click the Run Code button, the current week comes to 54?

I have an application that uses the week value to pull up new content each week and was able to update the database to “fix” it. But if anyone has an application that uses the week value, this could potentially cause an issue.

Just wanted to let everyone know. Not sure what docs.lucee.org is running on, but I’ve verified with different versions of Windows server and even spun up one running Lucee 4.5.5 just out of curiosity… happens everywhere.

Thanks!

Austin

Don’t forget to tell us about your stack!

OS: ???
Java Version: ???
Tomcat Version: ???
Lucee Version: ???

Hi @LuceeBoston, thank you for submitting. Just checked it also. Running the code now gave me the correct week of 53. But then I ran the code with day 27. December 2020 and it output 54.

Just filed the bug:

Thanks for posting.

Believe me here in Melbourne Vic where we hold the record for consecutive days locked down, this year feels like 54 weeks long :wink:

2 Likes

Added note to bug report. The JREDateTimeUtil.java getWeekOfYear() code incorrectly pushes all day 1 of week 1 on a leap year to 54 weeks incorrectly. trycf uses UTC (Sunday-12/27/2020=start of week 1). Other locales will be different.

1 Like

Really appreciate your help everyone!

Austin

1 Like