Skip to content
This repository has been archived by the owner on Jun 13, 2018. It is now read-only.

Take into account business hours for UPS delivery estimates #362

Merged
merged 1 commit into from
Apr 26, 2016

Conversation

jonathankwok
Copy link
Contributor

@jonathankwok jonathankwok commented Apr 26, 2016

Summary

Time zone shiftiness going on:

[1] pry(main)> Date.today
=> Tue, 26 Apr 2016
[2] pry(main)> 3.business_days.from_now
=> 2016-05-02 09:00:00 +0000
[3] pry(main)> 3.business_days.after(Date.today)
=> Fri, 29 Apr 2016

from_now just adds the n days, whereas .after takes into account business hours, adding an extra day if the present time is past business hours (which is why it's flaky right now, since most of the time we're running our builds outside of business hours for the system (UTC)).

Carrier responses take into account business time and rolling forward, so we should too in our tests.

Fixes half of the red build - the other half is fixed by #361
Review: @kmcphillips @RichardBlair @mdking @MalazAlamir

@RichardBlair
Copy link
Contributor

:shipit:

@MalazAlamir
Copy link
Contributor

🚢

@jonathankwok jonathankwok changed the title Change UPS remote tests to take into account business hours for delivery estimates Take into account business hours for UPS delivery estimates Apr 26, 2016
@jonathankwok jonathankwok merged commit fbbe5c4 into master Apr 26, 2016
@jonathankwok jonathankwok deleted the better-business-time branch April 26, 2016 21:08
maartenvg pushed a commit that referenced this pull request Nov 9, 2017
Take into account business hours for UPS delivery estimates
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants