Git Product home page Git Product logo

Comments (4)

907th avatar 907th commented on May 25, 2024 1

The problem has been resolved in the mentioned MR to the Ruby on Rails.

from faker.

907th avatar 907th commented on May 25, 2024

I also note that Faker::Time.between returns time in the application time zone, whereas Faker::Time.backward (.forward) returns time in UTC.

from faker.

907th avatar 907th commented on May 25, 2024

Hello. After some thinking, I realized that the problem may be not in the Faker gem. May be it is Rails testing helper #travel_to who breaks Date.today:

I run test:

it "TEST" do
  t = Time.current.beginning_of_day
  travel_to t do
    debugger
  end
end

and made experiments:

(byebug) Time.now
2023-11-30 21:00:00 +0000
(byebug) Date.current
Fri, 01 Dec 2023
(byebug) Date.today
Fri, 01 Dec 2023
(byebug) Rails.version
"7.0.8"

I think that Date.today must equal to 2023-11-30 in this case.

from faker.

thdaraujo avatar thdaraujo commented on May 25, 2024

Nice find! Thanks for fixing the problem!

from faker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.