Faker's en.yml file doesn't include a nil value for the month_names array, which causes the months to be offset by one. This causes dates to be one month ahead when formatted.
Describe the steps to reproduce the behavior.
without Faker...
irb(main):007:0> Date.today
=> Wed, 31 Jul 2019
irb(main):001:0> I18n.l(Date.today, format: :long)
=> "July 31, 2019"
irb(main):002:0> I18n.t("date.month_names")
=> [nil, "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
with faker...
irb(main):003:0> require 'faker'
=> true
irb(main):007:0> Date.today
=> Wed, 31 Jul 2019
irb(main):004:0> I18n.l(Date.today, format: :long)
=> "August 31, 2019"
irb(main):006:0> I18n.t("date.month_names")
=> ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
This problem is also described in https://github.com/spree/spree/pull/2427
@crispinheneise thanks for reporting 馃憤
@crispinheneise @jutonz I know this can be a bit impactful, but I'd prefer to wait for other small bug fixes/minor enhancements before doing a minor release 2.1.0. We could do that in a few weeks.
Let me know if anyone disagrees with me. If this becomes a real big issue, we can accelerate the process.
It may not be an issue for some because Faker is typically not used in production. For me it was a breaking issue because every place where I18n.l was used began to display the wrong date, causing my test suite to fail.
I found this after narrowing down the test suite failure to the faker gem update. It's not particularly obvious why or where the failure is coming from so I imagine it would cause some frustration.
I just did a small release. No frustration anymore. Let me know if you see anything else.
I found this after narrowing down the test suite failure to the
fakergem update. It's not particularly obvious why or where the failure is coming from so I imagine it would cause some frustration.
@tconst Dependabot to the rescue. Dependabot had opened several PRs today, but the only one that failed CI was the faker upgrade. From there it was pretty easy to narrow it down.
Most helpful comment
I just did a small release. No frustration anymore. Let me know if you see anything else.