       year += (Math.floor(today.getFullYear() / 100) * 100)
 
   new Date(year, month, day)
+
+days_ago = (days) ->
+  milliseconds_per_day = 86400000
+  new Date(+new Date - milliseconds_per_day * (days - 1))
+
+weeks_ago = (weeks) ->
+  days_ago(weeks * 7)
 
 handle_comment = (msg) ->
   type = msg.match[0]

  
  robot.respond /retro\s*([^\s]+)?\s?([^\s]+)?$/i, (msg) ->

    start_date = date_from_string(msg.match[1])
    unless start_date?
      msg.send "Please specify a start date as <month>/<day> or <month>/<day>/<year>"
      return

    end_date = new Date()
    end_date_string = msg.match[2]
    if end_date_string?
      end_date = date_from_string(end_date_string)
      unless end_date
        msg.send "Please specify the end date as <month>/<day> or <month>/<day>/<year> or leave emtpy for the current date"
        return

    msg.send "Showing retro comments from #{start_date} to #{end_date}.\n"

    items = {}
    items.good = []

#
# Commands:
#   [good|bad|park]: <comment> - store a comment
#   hubot retro - show all comments in the last 2 weeks
#   hubot retro <month>/<day>[/<year>] - show all comments since <month>/<day>[/<year>]
#   hubot retro <month>/<day>[/<year>] <month>/<day>[/<year>] - show all comments between the given dates

