Overview
The service hours configuration controls when your water delivery service is available to accept orders. This system supports different hours for weekdays and weekends, special closed dates, and can be overridden remotely via Edge Config.Service hours can be configured both locally in
src/config/serviceHours.js and remotely via Edge Config.Configuration File
The service hours are defined insrc/config/serviceHours.js:4-27.
Configuration Options
Service start hour in 24-hour format (0-23)
Service start minute (0-59)
Service end hour in 24-hour format (0-23)
Service end minute (0-59)
Enable service on weekdays (Monday-Friday)
Enable service on weekends (Saturday-Sunday)
Array of dates when service is closed, in
YYYY-MM-DD formatExample: ['2024-01-01', '2024-12-25']When enabled, service is always considered open regardless of time checks
Usage Examples
Checking Service Status
src/config/serviceHours.js
Getting Active Configuration
Getting Next Service Time
src/config/serviceHours.js
Configuration Examples
Standard Business Hours
src/config/serviceHours.js
Weekdays Only
src/config/serviceHours.js
With Holiday Closures
src/config/serviceHours.js
How It Works
The service hours system follows this logic (seesrc/config/serviceHours.js:74-117):
Load Edge Config
First, the system loads any remote configuration from Edge Config that may override local settings.
Check Store Status
If the store is manually closed, temporarily closed, or in maintenance mode, return false immediately.
Check Closed Dates
Compare current date against the
closedDates array. If today is in the list, return false.Store Status Control
In addition to time-based rules, service can be controlled via store status flags:Master switch for the entire store
Temporarily close the store (e.g., during emergencies)
Enable maintenance mode to prevent all orders
Optional reason for closure (displayed to customers)
Store status can be controlled remotely via Edge Config without deploying code changes. See Edge Config for details.
Related Configuration
- Edge Config - Override service hours remotely
- Damacana Limits - Time restrictions for water jug orders