     y = i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousands_separator)
     sign + currency_symbol + x + y
 
-Date.months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]
-Date::getNiceDate = ->
-  Date.months[@getMonth()] + ' ' + @getDate() + ', ' + @getFullYear()
+  toNiceDate: (date) ->
+    date = new Date(String(date))
+    @months[date.getMonth()] + ' ' + date.getDate() + ', ' + date.getFullYear()
 
-Date::getMonthName = ->
-  Date.months[@getMonth()]
+  getMonthName: (date) ->
+    date = new Date(String(date))
+    @months[date.getMonth()]
 
 class Cash
   constructor: (@robot) ->

        else
          diff_type = 'less'

        output += ", which is #{Math.abs(diff).toDollars()} #{diff_type} than on #{last_cash.date.getNiceDate()}. "
      else
        output += "."

      output += "\nAt our current burn rate (#{current_burn.rate.toDollars()} / month), we have #{months} months left. That gets us to #{end_date.getMonthName()} #{end_date.getFullYear()}."

      msg.send output
    else

module.exports = (robot) ->

  cash = new Cash robot
  optf = new OutputFormatter()

  robot.respond /cash (left|on hand)( is)? (.+)$/i, (msg) ->
    amount = cash.set_on_hand msg.match[3]
    msg.send "Ok, cash on hand is #{optf.toDollars(amount)}"

  robot.respond /cash burn( rate)?( is)? (.+)$/i, (msg) ->
    amount = cash.set_burn_rate msg.match[3]
    msg.send "Ok, our burn rate is #{optf.toDollars(amount)} per month"

  robot.respond /cash (stats|state|update)/i, (msg) ->
    data = cash.data()
