lennym / moment-business-time

Query and manipulate moment objects within the scope of business/working hours
MIT License
73 stars 48 forks source link

Test fail on desktop with timezone CEST #24

Open milovanderlinden opened 7 years ago

milovanderlinden commented 7 years ago

I am in the Europe/Amsterdam Timezone. When I run npm test, one test fails. When I switch my desktop to a none summer/wintertime zone (like GMT) the tests pass.

holidays
      ✓ does not count holidays as working days
      1) does not include holidays when adding working time
      ✓ does not include holidays when adding calculating diffs
      ✓ supports holidays as wildcards

  63 passing (120ms)
  1 failing

  1) moment.business-hours holidays does not include holidays when adding working time:

      AssertionError: expected '2015-03-02 13:00:00.000' to equal '2015-03-02 12:00:00.000'
      + expected - actual

      -2015-03-02 13:00:00.000
      +2015-03-02 12:00:00.000

      at Context.<anonymous> (test/spec.business-hours.js:474:91)
lennym commented 7 years ago

Thanks for raising this. I think the "best" approach is probably to have a means of allowing a user to use moment-timezone as opposed to the basic moment module, but I'm not 100% sure on the best way to do that as I don't actually use this module (or moment) on a regular basis.

I'll have a bit of a think on it.