beardofedu / beardofedu/hackathon-winners
Bug: Delivery ETAs don't account for weekends
- Dominant language
- HTML
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Bug Report
### Description
Estimated delivery dates are calculated without accounting for weekends. A shipment picked up on a Friday with a **3-day Ground** service will show a delivery ETA of Monday — but the system is currently adding 3 calendar days, showing Sunday as the ETA. Carriers don't deliver on Sundays (and some don't deliver on Saturdays either).
### Steps to reproduce
1. Look at any Ground service shipment picked up on a Thursday or Friday
2. Compare the `estimatedDelivery` date in the data to what it *should* be with business-days-only calculation
3. The current dates in `shipments.js` are hardcoded, but any new shipment creation utility would reproduce this
### Expected behavior
ETA calculation should skip weekends (Saturday and Sunday) when computing delivery dates for Ground and Standard services. Overnight/Priority services may still use calendar days.
### Acceptance criteria
- [ ] A `calculateETA(pickupDate, serviceDays, service)` utility function exists in `src/utils/formatters.js`
- [ ] The function skips Saturdays and Sundays for Ground/Standard service types
- [ ] Overnight and Priority services continue to use calendar days
- [ ] Unit tests or inline examples in a comment demonstrate the correct behavior
---
*Demo app is in the `/demo` directory. Run `npm install && npm run dev` to start.*
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading src/utils/formatters.js and inspect the hardcoded dates in shipments.js to understand the current ETA behavior. Run npm install && npm run dev in /demo if visual verification helps, then add the calculateETA utility and tests or inline examples covering weekend-skipping Ground/Standard services and calendar-day Overnight/Priority services.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100