   forecast = ->
     now = new Date()
 
-    isWeekday = (now.getDay() < 6)
-    isBusinessHours = (now.getUTCHours() >= 11 && now.getUTCHours() <= 23)
-
-    if isWeekday && isBusinessHours
-
-      # Only run during business hours
+    isActive =
+      now.toUTCString().substr(0,3).toLowerCase() in activeDays and
+      now.getUTCHours() in activeHours
+
+    if isActive
+
+      # Only run during specified time windows
 
       room = process.env.HUBOT_FORECAST_ROOM
       fetchForecast (msg, dataPoint) ->


KV_KEY = 'forecast-alert-datapoint'
LOCATION = process.env.HUBOT_LAT_LNG

module.exports = (robot) ->
  postWeatherAlert = (json, callback) ->

#   A hubot script to alert for inclement weather
#
# Configuration:
#   HUBOT_FORECAST_DAYS - When do you need weather? Default: mon,tue,wed,thu,fri
#   HUBOT_FORECAST_KEY - forecast.io API key
#   HUBOT_FORECAST_ROOM - Room bulletins should be posted in
#   HUBOT_FORECAST_TIME - On/off times in hours. Default 11-23
#   HUBOT_LAT_LNG
#
# Commands:
#   None
#
# Notes:
#   This script sets up automated alerts, and rquires only that the
#   necessary EnvVars be set. See the README for details.
#   All dates/times UTC
#
# Author:
#   farski
