 #       ii - minutes
 #       ss - seconds
 #       ap - am / pm
-# 
+#
 # returns the formatted date
 formatDate = (dateStamp, fmt = 'mm/dd/yyyy at hh:ii ap') ->
   d = new Date(dateStamp)
-  
+
   # split up the date
-  [m,d,y,h,i,s,ap] = 
+  [m,d,y,h,i,s,ap] =
     [d.getMonth() + 1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds(), 'AM']
-  
+
   # leadig 0s
   i = "0#{i}" if i < 10
   s = "0#{s}" if s < 10
-  
+
   # adjust hours
   if h > 12
-    h = h - 12 
+    h = h - 12
     ap = "PM"
-  
+
   # ghetto fab!
   fmt
     .replace(/mm/, m)

            _.push "You have #{data.total_count} issue(s)."
          else
            _.push "#{user.firstname} has #{data.total_count} issue(s)."
            
          for issue in data.issues
            do (issue) ->
              _.push "\n[#{issue.tracker.name} - #{issue.priority.name} - #{issue.status.name}] ##{issue.id}: #{issue.subject}"
          
          msg.reply _.join "\n"

  # Robot update <issue> with "<note>"
  robot.respond /update (?:issue )?(?:#)?(\d+)(?:\s*with\s*)?(?:[-:,])? (?:"?([^"]+)"?)/, (msg) ->
    [id, note] = msg.match[1..2]
    
    attributes =
      "notes": "#{msg.message.user.name}: #{note}"
    
    redmine.Issue(id).update attributes, (err, data) ->
      if err?
        if err == 404

            date = formatDate journal.created_on, 'mm/dd/yyyy (hh:ii ap)'
            _.push "#{journal.user.name} on #{date}:"
            _.push "    #{journal.notes}\n"

      msg.reply _.join "\n"

# simple ghetto fab date formatter this should definitely be replaced, but didn't want to
# introduce dependencies this early
#
# dateStamp - any string that can initialize a date
# fmt - format string that may use the following elements
#       mm - month
