In the Firefox console new Date(2021,12,31) I see "Date Mon Jan 31 2022 00:00:00 GMT -600 (CST)
but new Date(2021,12,31).toLocaleDateString() yields "1/30/2022" so it appears the day of the month has been decremeted from 31 to 30. This happens for me in any tab unless I open the Preferences tab. In that tab, in the console output, I get the expected "1/31/2022" This has been occurring for a long time on Firefox for me on -current on at least two OpenBSD boxes running Firefox updated with pkg_add -D snap -u The reason it's a problem is a browser password manager displaying a credit card date will decrement the month. For example, if an expiration date of 01/21 for January 2021 is stored in the password manager, then the browser extension displays 12/20. This happens even if I display the browser extension's data while in the Firefox preferences tab. I have been informed by the extension developers that the browser, and not their extension, handles the date. I've only noticed the problem on my OpenBSD boxes and not on other operating systems. I've tried changing the language and unchecking the "use operating system preferences" box in Firefox preferences. I see there was an old bug that has been resolved in LocaleDateString that caused these off-by-one errors, but I am guessing it's something else since the correct date is displayed sometimes -- only when I use the web developer console in a tab used by Firefox Preferences. Creating new profiles, clearing the cache, etc. has had no effect. Currently running OpenBSD 6.9-beta (GENERIC.MP) #449: Sun Apr 4 00:53:21 MDT 2021 [email protected]:/usr/src/sys/arch/ amd64/compile/GENERIC.MP and Firefox 87.0 (64-bit).
